diff --git a/.gitignore b/.gitignore index b25add8..8d7a6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ ui_*.h /*.trace /paysages3d-linux/ /paysages3d-linux.tar.bz2 +/config.vim diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..11e7ed1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: cpp + +before_script: + - if [ "$CXX" = "g++" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi + - if [ "$CXX" = "g++" ]; then sudo apt-get update -qq; fi + - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8; fi + - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50; fi + - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50; fi + - wget -O Qt5.2.0.tar.xz https://dl.dropboxusercontent.com/u/20447449/Qt5.2.0.tar.xz + - mkdir ~/Qt5.2.0 + - tar -xJf Qt5.2.0.tar.xz -C ~/Qt5.2.0 + - sudo chmod -R 777 ~/Qt5.2.0/ + - ln -s ~/Qt5.2.0/5.2.0/gcc_64/mkspecs/linux-g++ ~/Qt5.2.0/5.2.0/gcc_64/mkspecs/linux-gcc + - make BUILDMODE=debug QTSDK=~/Qt5.2.0/5.2.0/gcc_64 + +script: make BUILDMODE=debug QTSDK=~/Qt5.2.0/5.2.0/gcc_64 tests diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index e79cc1d..0000000 --- a/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -????-??-?? Technology Preview 2 -------------------------------- - -Global : - * Version handling in saved files. - * Replaced old noise algorithm with Simplex Noise (up to 4 times faster). - * New noise settings for better shape control. - -Terrain : - * Added canvases to paint the shape directly. - * Shadows have been improved and are now configurable. - -Textures : - * New texture model (perpendicular displacement and thickness). - * Textures ranges are now using curves. - -Water : - * Revamped light-based coloring. - * Added foam. - -Atmosphere : - * Merged with sky module. - * New sky model and aerial perspective (based on Preetham's work). - * Better previews. - -Clouds : - * Added clouds hardness to light. - * New cloud model with 2 noises : one for the global shape and one for edges. - * Added clouds types with automatic settings. - -Rendering : - * Added full scene antialiasing (FSAA). - * High Dynamic Range lighting. - -GUI : - * Improved curve rendering. - * New material editor. - * Added render timer. - * Previews locations and render params are now saved. - * Added grid and axis labels to curve editor. - * Added layer sorting and naming. - * Automatic settings can be loaded from presets. - -Previews : - * Scaling is now logarithmic (slower when zoomed). - * Drawing now takes advantage of multiple CPU cores. - * Added camera location. - * Added toggles and choices to configure some previews. - -3D Explorer: - * Added ground texture and skybox. - * Progressive rendering now takes advantage of multiple CPU cores. - -2012-04-20 Technology Preview 1 -------------------------------- - -First preview version : - * Ground with simple texture layers - * Water with waves, transparency and reflection - * Sky with sun - * Atmosphere with fog - * Cloud 3d layers - * Two-pass rendering - * Form-based GUI, with real-time previews diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c33dcc7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/Makefile b/Makefile index 1fb966d..56d7343 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ BUILDMODE=release +QTSDK= BUILDPATH=./build/${BUILDMODE} LIBRARY_PATH=${BUILDPATH}/system:${BUILDPATH}/basics:${BUILDPATH}/definition:${BUILDPATH}/render/software:${BUILDPATH}/render/preview:${BUILDPATH}/render/opengl:${BUILDPATH}/tests/googletest BUILD_SPEC=linux-g++ +PATH:=${QTSDK}/bin:${PATH} all:build diff --git a/README.md b/README.md new file mode 100644 index 0000000..d83379e --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Paysages 3D +=========== + +[![Build Status](https://travis-ci.org/thunderk/paysages3d.png)](https://travis-ci.org/thunderk/paysages3d) + +About +----- + +[Paysages 3D](http://www.paysages3d.com) is a work-in-progress landscape generator, modeler and renderer software. + +It is written in C++ 11, using Qt 5.2 as only dependency. + +[![Screenshot 1](data/screenshots/small1.jpg)](data/screenshots/large1.jpg) [![Screenshot 2](data/screenshots/small2.jpg)](data/screenshots/large2.jpg) [![Screenshot 3](data/screenshots/small3.jpg)](data/screenshots/large3.jpg) + +Build/Run +--------- + +At the moment, the build system is only well tested using the latest [QtSDK](http://qt-project.org/downloads) installation, and [QtCreator](http://qt-project.org/downloads#qt-creator). Later work will remove this dependency. + +Simply open the *src/paysages.pro* file in QtCreator, and make a shadow build. + +You can then run the compiled program **from the top project directory** (the one that contains *src* and *data*). + +Licensing +--------- + +The source code is subject to the terms of the [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/). Read the full terms in the LICENSE file. + +Credits +------- + +* [Michaël Lemaire](http://thunderk.net) - Main developer +* [Eric Bruneton and Fabrice Neyet](http://www-evasion.imag.fr/Membres/Eric.Bruneton/) - Publication and source code from *Precomputed Atmospheric Scattering (2008)* +* [Qt](http://qt-project.org/) - Library in use +* [GoogleTest](https://code.google.com/p/googletest/) - Included library diff --git a/config.vim b/config.vim deleted file mode 100644 index 9544134..0000000 --- a/config.vim +++ /dev/null @@ -1,18 +0,0 @@ -function! UpdateTags() - !ctags --recurse=yes ./src/ -endfunction - -function! RunDebug() - UpdateTags() - !make BUILDMODE=debug all run_qt -endfunction - -function! RunRelease() - UpdateTags() - !make BUILDMODE=debug all run_qt -endfunction - -map :call RunDebug() -map :call RunRelease() -map :!make tests - diff --git a/data/screenshots/large1.jpg b/data/screenshots/large1.jpg new file mode 100644 index 0000000..a943b1f Binary files /dev/null and b/data/screenshots/large1.jpg differ diff --git a/data/screenshots/large2.jpg b/data/screenshots/large2.jpg new file mode 100644 index 0000000..70b641a Binary files /dev/null and b/data/screenshots/large2.jpg differ diff --git a/data/screenshots/large3.jpg b/data/screenshots/large3.jpg new file mode 100644 index 0000000..f9e125f Binary files /dev/null and b/data/screenshots/large3.jpg differ diff --git a/data/screenshots/small1.jpg b/data/screenshots/small1.jpg new file mode 100644 index 0000000..0777595 Binary files /dev/null and b/data/screenshots/small1.jpg differ diff --git a/data/screenshots/small2.jpg b/data/screenshots/small2.jpg new file mode 100644 index 0000000..9ea2d16 Binary files /dev/null and b/data/screenshots/small2.jpg differ diff --git a/data/screenshots/small3.jpg b/data/screenshots/small3.jpg new file mode 100644 index 0000000..e5844b4 Binary files /dev/null and b/data/screenshots/small3.jpg differ diff --git a/debian/README b/debian/README deleted file mode 100644 index 9c50916..0000000 --- a/debian/README +++ /dev/null @@ -1,6 +0,0 @@ -The Debian Package paysages3d ----------------------------- - -Comments regarding the Package - - -- Michael Lemaire Sun, 16 Jun 2013 09:36:17 +0200 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 67f424f..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -paysages3d (0.2-1) stable; urgency=low - - * Beta 2 release. - - -- Sun, 16 Jun 2013 09:42:45 +0000 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100644 index 68fdadd..0000000 --- a/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: paysages3d -Section: graphics -Priority: extra -Maintainer: Michael Lemaire -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.3 - -Package: paysages3d -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, libglib2.0-0, libdevil1c2, libqtcore4, libqtgui4, libqt4-opengl -Description: Paysages 3D is a landscape synthesizer and renderer - Paysages 3D is a work-in-progress 3D software, allowing to model, preview, and render vast natural sceneries, with ground, sky, clouds... diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index bb30297..0000000 --- a/debian/copyright +++ /dev/null @@ -1,29 +0,0 @@ -This package was debianized by Michael Lemaire on -Sun, 16 Jun 2013 09:36:17 +0200. - -Copyright: - - Copyright (C) 2013 Michael Lemaire - -License: - - This package is free software; 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 package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. - -The Debian packaging is (C) 2013, Michael Lemaire and -is licensed under the GPL, see above. - diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index bec1a16..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -usr/share/paysages3d diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 2999b46..0000000 --- a/debian/rules +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - - - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - $(MAKE) - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - -$(MAKE) "DESTDIR=$(CURDIR)/debian/paysages3d" clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - $(MAKE) "DESTDIR=$(CURDIR)/debian/paysages3d" install - -binary-indep: build install - -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs -# dh_installdocs -# dh_installexamples - dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_pysupport -# dh_installinit -# dh_installcron -# dh_installinfo -# dh_installman debian/*.1 - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure - diff --git a/src/basics/Color.h b/src/basics/Color.h index 5dd8aaa..074fdda 100644 --- a/src/basics/Color.h +++ b/src/basics/Color.h @@ -6,7 +6,7 @@ namespace paysages { namespace basics { -class Color +class BASICSSHARED_EXPORT Color { public: Color(); diff --git a/src/basics/Geometry.h b/src/basics/Geometry.h index ff3bd19..6a75f85 100644 --- a/src/basics/Geometry.h +++ b/src/basics/Geometry.h @@ -6,7 +6,7 @@ namespace paysages { namespace basics { -class Geometry +class BASICSSHARED_EXPORT Geometry { public: static double get2DAngle(double x, double y); diff --git a/src/basics/Matrix4.cpp b/src/basics/Matrix4.cpp index 7c65b05..b32fc05 100644 --- a/src/basics/Matrix4.cpp +++ b/src/basics/Matrix4.cpp @@ -2,6 +2,7 @@ #include #include "PackStream.h" +#include "Vector3.h" Matrix4::Matrix4(bool identity) { diff --git a/src/basics/Matrix4.h b/src/basics/Matrix4.h index 42954c7..03c454f 100644 --- a/src/basics/Matrix4.h +++ b/src/basics/Matrix4.h @@ -3,7 +3,6 @@ #include "basics_global.h" -#include "Vector3.h" #ifdef QT_GUI_LIB #include #endif diff --git a/src/basics/SpaceSegment.h b/src/basics/SpaceSegment.h index d7220ef..4abfe86 100644 --- a/src/basics/SpaceSegment.h +++ b/src/basics/SpaceSegment.h @@ -5,15 +5,13 @@ #include "Vector3.h" -namespace paysages -{ -namespace basics -{ +namespace paysages { +namespace basics { /*! * \brief A segment in 3D space (mainly useful for rays). */ -class SpaceSegment +class BASICSSHARED_EXPORT SpaceSegment { public: SpaceSegment(const Vector3& start, const Vector3& end); diff --git a/src/basics/Texture2D.h b/src/basics/Texture2D.h index 67d1649..1e762bb 100644 --- a/src/basics/Texture2D.h +++ b/src/basics/Texture2D.h @@ -6,7 +6,7 @@ namespace paysages { namespace basics { -class Texture2D +class BASICSSHARED_EXPORT Texture2D { public: Texture2D(int xsize, int ysize); diff --git a/src/basics/Texture3D.h b/src/basics/Texture3D.h index 8a68208..b73301c 100644 --- a/src/basics/Texture3D.h +++ b/src/basics/Texture3D.h @@ -6,7 +6,7 @@ namespace paysages { namespace basics { -class Texture3D +class BASICSSHARED_EXPORT Texture3D { public: Texture3D(int xsize, int ysize, int zsize); diff --git a/src/basics/Texture4D.h b/src/basics/Texture4D.h index 6b53580..18a863f 100644 --- a/src/basics/Texture4D.h +++ b/src/basics/Texture4D.h @@ -6,7 +6,7 @@ namespace paysages { namespace basics { -class Texture4D +class BASICSSHARED_EXPORT Texture4D { public: Texture4D(int xsize, int ysize, int zsize, int wsize); diff --git a/src/basics/basics_global.h b/src/basics/basics_global.h index 4ea3e7c..591f672 100644 --- a/src/basics/basics_global.h +++ b/src/basics/basics_global.h @@ -29,4 +29,14 @@ namespace basics { } using namespace paysages::basics; +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 +#endif +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 +#endif + #endif // BASICS_GLOBAL_H diff --git a/src/definition/AtmosphereDefinition.h b/src/definition/AtmosphereDefinition.h index 39d4838..0067ecf 100644 --- a/src/definition/AtmosphereDefinition.h +++ b/src/definition/AtmosphereDefinition.h @@ -11,7 +11,7 @@ namespace paysages { namespace definition { -class AtmosphereDefinition : public BaseDefinition +class DEFINITIONSHARED_EXPORT AtmosphereDefinition : public BaseDefinition { public: typedef struct diff --git a/src/definition/CameraDefinition.h b/src/definition/CameraDefinition.h index e8b3364..faab350 100644 --- a/src/definition/CameraDefinition.h +++ b/src/definition/CameraDefinition.h @@ -19,7 +19,7 @@ typedef struct double zfar; } CameraPerspective; -class BASICSSHARED_EXPORT CameraDefinition: public BaseDefinition +class DEFINITIONSHARED_EXPORT CameraDefinition: public BaseDefinition { public: CameraDefinition(); diff --git a/src/definition/WaterDefinition.h b/src/definition/WaterDefinition.h index aa8ca3e..3db7b3c 100644 --- a/src/definition/WaterDefinition.h +++ b/src/definition/WaterDefinition.h @@ -8,7 +8,7 @@ namespace paysages { namespace definition { -class WaterDefinition: public BaseDefinition +class DEFINITIONSHARED_EXPORT WaterDefinition: public BaseDefinition { public: WaterDefinition(BaseDefinition* parent); diff --git a/src/interface/desktop/baseform.cpp b/src/interface/desktop/baseform.cpp index 9283a4f..5b8faf4 100644 --- a/src/interface/desktop/baseform.cpp +++ b/src/interface/desktop/baseform.cpp @@ -374,6 +374,10 @@ void BaseForm::addPreview(BasePreview* preview, QString label) _previews->layout()->addWidget(label_widget); _previews->layout()->addWidget(preview); + preview->setMinimumSize(256, 256); + preview->setMaximumSize(256, 256); + preview->resize(256, 256); + _previews_list.append(preview); } diff --git a/src/interface/desktop/common/mainwindow.ui b/src/interface/desktop/common/mainwindow.ui index 8958a02..6a676eb 100644 --- a/src/interface/desktop/common/mainwindow.ui +++ b/src/interface/desktop/common/mainwindow.ui @@ -14,7 +14,7 @@ Paysages 3D - + :/logo/images/logo_32.png:/logo/images/logo_32.png @@ -162,7 +162,7 @@ Explore in 3D - + :/buttons/logo/images/explore.png:/buttons/logo/images/explore.png @@ -176,7 +176,7 @@ Render - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -209,7 +209,7 @@ New - + :/buttons/logo/images/new.png:/buttons/logo/images/new.png @@ -220,7 +220,7 @@ Save - + :/buttons/logo/images/save.png:/buttons/logo/images/save.png @@ -231,7 +231,7 @@ Load - + :/buttons/logo/images/load.png:/buttons/logo/images/load.png @@ -268,7 +268,7 @@ - + :/tabs/images/tab_terrain.png:/tabs/images/tab_terrain.png @@ -277,7 +277,7 @@ - + :/tabs/images/tab_textures.png:/tabs/images/tab_textures.png @@ -332,7 +332,7 @@ 0 0 946 - 25 + 20 @@ -364,7 +364,7 @@ - + :/buttons/logo/images/explore.png:/buttons/logo/images/explore.png @@ -379,7 +379,7 @@ - + :/buttons/logo/images/new.png:/buttons/logo/images/new.png @@ -394,7 +394,7 @@ - + :/buttons/logo/images/load.png:/buttons/logo/images/load.png @@ -409,7 +409,7 @@ - + :/buttons/logo/images/save.png:/buttons/logo/images/save.png @@ -424,7 +424,7 @@ - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -439,7 +439,7 @@ - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -454,7 +454,7 @@ - + :/buttons/logo/images/about.png:/buttons/logo/images/about.png @@ -469,7 +469,7 @@ - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -498,7 +498,7 @@ - + diff --git a/src/interface/desktop/common/widgetglobalformbuttons.ui b/src/interface/desktop/common/widgetglobalformbuttons.ui index ff5bfdd..e8c5c32 100644 --- a/src/interface/desktop/common/widgetglobalformbuttons.ui +++ b/src/interface/desktop/common/widgetglobalformbuttons.ui @@ -32,7 +32,7 @@ Cancel - + :/buttons/logo/images/cancel.png:/buttons/logo/images/cancel.png @@ -49,7 +49,7 @@ Revert modifications - + :/buttons/logo/images/revert.png:/buttons/logo/images/revert.png @@ -66,7 +66,7 @@ Validate - + :/buttons/logo/images/apply.png:/buttons/logo/images/apply.png @@ -74,7 +74,7 @@ - + diff --git a/src/interface/desktop/formatmosphere.cpp b/src/interface/desktop/formatmosphere.cpp index 37abd33..1285244 100644 --- a/src/interface/desktop/formatmosphere.cpp +++ b/src/interface/desktop/formatmosphere.cpp @@ -27,13 +27,13 @@ FormAtmosphere::FormAtmosphere(QWidget *parent): previewWest = new BasePreview(this); previewWestRenderer = new AtmosphereColorPreviewRenderer(_definition, M_PI / 2.0); - previewWest->setRenderer(previewWestRenderer); addPreview(previewWest, QString(tr("West preview"))); + previewWest->setRenderer(previewWestRenderer); previewEast = new BasePreview(this); previewEastRenderer = new AtmosphereColorPreviewRenderer(_definition, -M_PI / 2.0); - previewEast->setRenderer(previewEastRenderer); addPreview(previewEast, QString(tr("East preview"))); + previewEast->setRenderer(previewEastRenderer); //addInputEnum(tr("Color model"), (int*)&_definition->model, QStringList(tr("Simplified model (with weather)")) << tr("Complex model")); addInputInt(tr("Day time (hour)"), &_definition->hour, 0, 23, 1, 10); diff --git a/src/interface/desktop/lighting/DialogMaterialEditor.ui b/src/interface/desktop/lighting/DialogMaterialEditor.ui index 3b0eea4..2cd6599 100644 --- a/src/interface/desktop/lighting/DialogMaterialEditor.ui +++ b/src/interface/desktop/lighting/DialogMaterialEditor.ui @@ -9,7 +9,7 @@ 0 0 - 1091 + 1139 627 @@ -350,7 +350,7 @@ Cancel - + :/buttons/logo/images/cancel.png:/buttons/logo/images/cancel.png @@ -361,7 +361,7 @@ Revert - + :/buttons/logo/images/revert.png:/buttons/logo/images/revert.png @@ -372,7 +372,7 @@ Ok - + :/buttons/logo/images/apply.png:/buttons/logo/images/apply.png @@ -410,7 +410,7 @@ - + diff --git a/src/interface/desktop/terrain/dialogterrainpainting.ui b/src/interface/desktop/terrain/dialogterrainpainting.ui index eb2b84b..bef6f50 100644 --- a/src/interface/desktop/terrain/dialogterrainpainting.ui +++ b/src/interface/desktop/terrain/dialogterrainpainting.ui @@ -101,7 +101,7 @@ Commands - + :/buttons/logo/images/about.png:/buttons/logo/images/about.png @@ -788,7 +788,7 @@ input_brush_strength - + diff --git a/src/interface/desktop/terrain/mainterrainform.ui b/src/interface/desktop/terrain/mainterrainform.ui index b6b4958..fdfe52d 100644 --- a/src/interface/desktop/terrain/mainterrainform.ui +++ b/src/interface/desktop/terrain/mainterrainform.ui @@ -442,7 +442,7 @@ Render preview - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -453,7 +453,7 @@ Explore in 3D - + :/buttons/logo/images/explore.png:/buttons/logo/images/explore.png @@ -489,7 +489,7 @@ Revert modifications - + :/buttons/logo/images/revert.png:/buttons/logo/images/revert.png @@ -500,7 +500,7 @@ Apply modifications - + :/buttons/logo/images/apply.png:/buttons/logo/images/apply.png @@ -532,7 +532,7 @@ - + diff --git a/src/interface/desktop/textures/DialogTexturesLayer.ui b/src/interface/desktop/textures/DialogTexturesLayer.ui index 599eb8d..723bb78 100644 --- a/src/interface/desktop/textures/DialogTexturesLayer.ui +++ b/src/interface/desktop/textures/DialogTexturesLayer.ui @@ -209,7 +209,7 @@ Explore in 3D - + :/buttons/logo/images/explore.png:/buttons/logo/images/explore.png @@ -220,7 +220,7 @@ Cancel - + :/buttons/logo/images/cancel.png:/buttons/logo/images/cancel.png @@ -231,7 +231,7 @@ Validate - + :/buttons/logo/images/apply.png:/buttons/logo/images/apply.png @@ -245,7 +245,7 @@ Render preview - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -256,7 +256,7 @@ Load preset - + :/buttons/logo/images/auto.png:/buttons/logo/images/auto.png @@ -267,7 +267,7 @@ Revert - + :/buttons/logo/images/revert.png:/buttons/logo/images/revert.png @@ -288,7 +288,7 @@ - + diff --git a/src/interface/desktop/textures/maintexturesform.ui b/src/interface/desktop/textures/maintexturesform.ui index e703b30..c8b515d 100644 --- a/src/interface/desktop/textures/maintexturesform.ui +++ b/src/interface/desktop/textures/maintexturesform.ui @@ -100,7 +100,7 @@ Add layer - + :/buttons/logo/images/layer_add.png:/buttons/logo/images/layer_add.png @@ -120,7 +120,7 @@ Remove layer - + :/buttons/logo/images/layer_del.png:/buttons/logo/images/layer_del.png @@ -153,7 +153,7 @@ Edit layer - + :/buttons/logo/images/layer_rename.png:/buttons/logo/images/layer_rename.png @@ -186,7 +186,7 @@ Move layer up - + :/buttons/logo/images/layer_up.png:/buttons/logo/images/layer_up.png @@ -203,7 +203,7 @@ Move layer down - + :/buttons/logo/images/layer_down.png:/buttons/logo/images/layer_down.png @@ -358,7 +358,7 @@ Explore in 3D - + :/buttons/logo/images/explore.png:/buttons/logo/images/explore.png @@ -369,7 +369,7 @@ Render preview - + :/buttons/logo/images/render.png:/buttons/logo/images/render.png @@ -402,7 +402,7 @@ Load preset - + :/buttons/logo/images/auto.png:/buttons/logo/images/auto.png @@ -413,7 +413,7 @@ Revert modifications - + :/buttons/logo/images/revert.png:/buttons/logo/images/revert.png @@ -424,7 +424,7 @@ Apply modifications - + :/buttons/logo/images/apply.png:/buttons/logo/images/apply.png @@ -445,7 +445,7 @@ - + diff --git a/src/render/preview/AtmosphereColorPreviewRenderer.h b/src/render/preview/AtmosphereColorPreviewRenderer.h index 455e888..fceb391 100644 --- a/src/render/preview/AtmosphereColorPreviewRenderer.h +++ b/src/render/preview/AtmosphereColorPreviewRenderer.h @@ -6,7 +6,7 @@ namespace paysages { namespace preview { -class AtmosphereColorPreviewRenderer:public Base2dPreviewRenderer +class PREVIEWSHARED_EXPORT AtmosphereColorPreviewRenderer:public Base2dPreviewRenderer { public: AtmosphereColorPreviewRenderer(AtmosphereDefinition* definition, double heading); diff --git a/src/render/preview/BasePreview.cpp b/src/render/preview/BasePreview.cpp index 63f8d80..bbac1c1 100644 --- a/src/render/preview/BasePreview.cpp +++ b/src/render/preview/BasePreview.cpp @@ -413,9 +413,7 @@ DrawingWidget(parent) QObject::connect(this, SIGNAL(contentChange()), this, SLOT(update())); - this->setMinimumSize(256, 256); - this->setMaximumSize(256, 256); - this->resize(256, 256); + setMinimumSize(10, 10); startTimer(50); } diff --git a/src/render/preview/BasePreview.h b/src/render/preview/BasePreview.h index 6d1e3e0..d182ed7 100644 --- a/src/render/preview/BasePreview.h +++ b/src/render/preview/BasePreview.h @@ -28,7 +28,7 @@ public: bool value; }; -class BasePreview : public DrawingWidget +class PREVIEWSHARED_EXPORT BasePreview : public DrawingWidget { Q_OBJECT diff --git a/src/render/preview/DrawingWidget.h b/src/render/preview/DrawingWidget.h index fd733cf..fbe6d61 100644 --- a/src/render/preview/DrawingWidget.h +++ b/src/render/preview/DrawingWidget.h @@ -11,7 +11,7 @@ class QPainter; namespace paysages { namespace preview { -class DrawingWidget : public QWidget +class PREVIEWSHARED_EXPORT DrawingWidget : public QWidget { Q_OBJECT public: diff --git a/src/render/preview/PreviewOsd.h b/src/render/preview/PreviewOsd.h index 9771429..c92f701 100644 --- a/src/render/preview/PreviewOsd.h +++ b/src/render/preview/PreviewOsd.h @@ -9,7 +9,7 @@ class QImage; namespace paysages { namespace preview { -class PreviewOsd +class PREVIEWSHARED_EXPORT PreviewOsd { public: PreviewOsd(); diff --git a/src/render/preview/PreviewOsdItem.h b/src/render/preview/PreviewOsdItem.h index b9b2c4c..8ab29ae 100644 --- a/src/render/preview/PreviewOsdItem.h +++ b/src/render/preview/PreviewOsdItem.h @@ -8,7 +8,7 @@ namespace paysages { namespace preview { -class PreviewOsdItem:public QImage +class PREVIEWSHARED_EXPORT PreviewOsdItem:public QImage { public: PreviewOsdItem(int width, int height); diff --git a/src/render/preview/TerrainShapePreviewRenderer.h b/src/render/preview/TerrainShapePreviewRenderer.h index 21ea419..1f4d574 100644 --- a/src/render/preview/TerrainShapePreviewRenderer.h +++ b/src/render/preview/TerrainShapePreviewRenderer.h @@ -8,7 +8,7 @@ namespace paysages { namespace preview { -class TerrainShapePreviewRenderer : public Base2dPreviewRenderer +class PREVIEWSHARED_EXPORT TerrainShapePreviewRenderer : public Base2dPreviewRenderer { public: explicit TerrainShapePreviewRenderer(TerrainDefinition* terrain); diff --git a/src/render/software/clouds/BaseCloudsModel.h b/src/render/software/clouds/BaseCloudsModel.h index 594ae04..09fa815 100644 --- a/src/render/software/clouds/BaseCloudsModel.h +++ b/src/render/software/clouds/BaseCloudsModel.h @@ -11,7 +11,7 @@ namespace software { /*! * \brief Abstract class for all cloud models (cirrus, cumulus...). */ -class BaseCloudsModel +class SOFTWARESHARED_EXPORT BaseCloudsModel { public: BaseCloudsModel(CloudLayerDefinition *layer); diff --git a/src/system/ParallelPool.h b/src/system/ParallelPool.h index 350d41e..d36832e 100644 --- a/src/system/ParallelPool.h +++ b/src/system/ParallelPool.h @@ -9,7 +9,7 @@ namespace system { /*! * Pool to handle a group of threads doing the same task. */ -class ParallelPool +class SYSTEMSHARED_EXPORT ParallelPool { public: ParallelPool(); diff --git a/src/system/system_global.h b/src/system/system_global.h index b557937..52e9755 100644 --- a/src/system/system_global.h +++ b/src/system/system_global.h @@ -1,7 +1,9 @@ #ifndef SYSTEM_GLOBAL_H #define SYSTEM_GLOBAL_H +#ifndef __MINGW32__ #define PAYSAGES_USE_INLINING 1 +#endif #include #if defined(SYSTEM_LIBRARY)