Compare commits

..

27 Commits

Author SHA1 Message Date
Robert Osfield
7f2eaa4339 Release OpenSceneGraph-3.2.0 2013-07-24 17:47:38 +00:00
Robert Osfield
789d435abe Updated ChangeLog 2013-07-24 17:29:50 +00:00
Robert Osfield
6b8db67c91 Changed default of serialize draw to OFF 2013-07-24 17:27:14 +00:00
Robert Osfield
2975f9c20a Updated README for 3.2 release 2013-07-24 14:23:37 +00:00
Robert Osfield
ebc855cf50 Removed release candidate number in prep for 3.2.0 release 2013-07-24 14:11:55 +00:00
Robert Osfield
c9547497cc Fixed typo 2013-07-24 14:05:08 +00:00
Robert Osfield
75d32b3af6 Updated ChangeLog 2013-07-24 13:29:22 +00:00
Robert Osfield
a844a278ab Added GL2Extensions::isDrawBuffersSupported() and usage with FrameBufferObject.cpp to prevent invalid MRT usage causing crash under GLES2 2013-07-24 13:01:38 +00:00
Robert Osfield
94dcfb4ec2 Updated NEWS for 3.2 release 2013-07-24 12:50:34 +00:00
Robert Osfield
8528449dff Fixed warning 2013-07-24 12:49:11 +00:00
Robert Osfield
8d7fd88d5f Added getCallbacks() methods 2013-07-24 12:17:10 +00:00
Robert Osfield
28dd1cf8a8 Updated ChangeLog, AUTHORS file, Release Candidate Number and SO version number for 3.2-rc4 2013-07-23 18:34:01 +00:00
Robert Osfield
14de2266ba From Rocco Martino, build fix for compiling against ffmpeg/trunk 2013-07-23 18:11:31 +00:00
Robert Osfield
cc02695822 Disabled the check for Asio for Windows 2013-07-23 15:36:45 +00:00
Robert Osfield
2c442c9e9a Added NOT ANDROID to force use of posix API when building for Android under Windows 2013-07-23 15:28:34 +00:00
Robert Osfield
ca44b9cbce Added lazy setting of the UserDataContainer to avoid unncessarily create a UserDataContain when an empty description list is passed to Node::setDescriptions(..) 2013-07-23 10:24:27 +00:00
Robert Osfield
0483912e32 Fixed crash when open(..) returns an error. 2013-07-23 09:54:28 +00:00
Robert Osfield
21b5109089 Updated ChangeLog and AUTHORS file for rc3 2013-07-23 05:45:34 +00:00
Robert Osfield
549e20fbe7 Fixed svn source to that it's relase candidates and final release made from the OpenSceneGraph-3.2 branch 2013-07-23 05:41:40 +00:00
Robert Osfield
b4b7a13063 From Torben Dannhauer, "Please find attached further changes to make library auto detection
functional again for some libraries:

    Find3rdPa..: Fix to find libxml2
    FindCollada: Rearranged to handle different MSVC versions more effective.
    This file is already prepared for the upcoming VS 2013.
    FindNVTT: introduced management of debug libraries (also auto detected).
    "
2013-07-23 05:25:45 +00:00
Robert Osfield
8b58890975 Updatected rc number 2, ChangeLog and AUTHORS file for OSG-3.2-rc2 release 2013-07-22 13:40:53 +00:00
Robert Osfield
871521cfea From Andreas Ekstrand, "Attached is a small modification of the Collada writer that protects from crashes due to valArray being NULL in some situations." 2013-07-22 13:31:32 +00:00
Robert Osfield
f19018a03d Added FRAME_BUFFER_OBJECT enum 2013-07-22 10:07:21 +00:00
Robert Osfield
2709a5e946 From Christian Ruzicka, "with the current touch implementation on iOS the touches are not forwarded to parent views because the base implementation is not called. Also see the "Best Practices" in the iOS documentation for event handling:
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

"If you handle events in a subclass of any other UIKit responder class:
- You do not have to implement all of the event handling methods.
- In the methods you do implement, be sure to call the superclass implementation. For example, [super touchesBegan:touches withEvent:event]."

I added the missing lines and tested it with OSG 3.1.9 and iOS SDK 6.1."
2013-07-19 21:03:28 +00:00
Robert Osfield
52d5d80508 Added default setting of BIND_PER_VERTEX when applying Geometry::setTexCoordArray() 2013-07-19 20:59:14 +00:00
Robert Osfield
86e465d5d8 Updated OpenThreads version to be in sync with OSG version. 2013-07-19 17:00:08 +00:00
Robert Osfield
50ed5ebd1c Branch OpenSceneGraph-3.2 2013-07-19 14:08:08 +00:00
1995 changed files with 120318 additions and 192514 deletions

View File

@@ -1,11 +0,0 @@
# CodeDocs.xyz Configuration File
DOXYFILE = doc/Doxyfiles/doxyfile.cmake
PROJECT_NUMBER =
PROJECT_LOGO = examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png
INPUT = include
STRIP_FROM_PATH = include/
HTML_FOOTER =
SEARCHENGINE = YES

94
.gitignore vendored
View File

@@ -1,94 +0,0 @@
doc/all_Doxyfile
doc/auto_Doxyfile
doc/core_Doxyfile
doc/openscenegraph.doxyfile
doc/openthreads.doxyfile
doc/OpenSceneGraphReferenceDocs/
doc/OpenThreadsReferenceDocs/
cmake_uninstall.cmake
include/OpenThreads/Config
include/OpenThreads/Version
include/osg/Config
include/osg/GL
include/osg/Version
include/osgQt/Version
src/osgQt/__
lib/
bin/
*.pc
*.conf
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest*.txt
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Platform Specifics - auto generated files
PlatformSpecifics/Windows/*.rc
# Visual studio - project files
*.sln
*.suo
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
# Visual Studio - Build Results
[Dd]ebug/
[Rr]elease/
[Mm]in[Ss]ize[Rr]el/
[Rr]el[Ww]ith[Dd]eb[Ii]nfo/
# Visual Studio - Browsing Database File
*.sdf
*.opensdf
#osx xcode
DerivedData/
*.DS_Store
*.build
*.xcodeproj
#CPACK related files
CPackConfig-*.cmake
_CPack_Packages/
#packages
*.tar.gz
*.zip

View File

@@ -1,68 +0,0 @@
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "0ROQiFbsZo33ce2v5VjBxNljemh/HU70ntSSPygYwaDFymubts/62SixXVkbKNIFdrs3uYD6qeA/eMmpqXxLcs+PXNq5NrH7eSWw9oDIKMhq3NQH/IZLdRfXwihHimZ1qEs/TXyWlT2aC4rpBi1py3cJeTh1aBMlz4V/nm16iRAgc596ThNTuPDHa0F9/gZnwccI/Rr9VpiYn7vEBbuY9lYr43D0G3NuuQyvvlHShroH09fh6KyFOWIY38AQtnuVGNC1fIiAUk7TUqDqSBwhIrUV5saHbP0kca6DP32REkv//h4JwM76UHv+ntVEoK/UiztJHMkrw71gXYTyvIvlDBpT+IDoeIwUW2QFNQ5zJZI7FM8k0+oeK+F7k/mkffDzr1zww/PQoxqFBF0PoxAni/L9qkA4X2o1A6mRDbe9besp2LQG6Vniwj3bHpCId2QiiMrANVg0EAqkcL2mVFEaqZsh90qCkr1UDq4WQoYbXh0Fy3UnQpbuxDvCME8u03lwuv6ds/SBxc5cgKv7oWXgezaDg7/OCR+0lIAGuLqmNRD8Xw7a0WZGmSbYCHIZmeyFja2KuUvMiVCt8+QsyZr3e523DwBwnSj1BIYFRstMaSEJgu9B8rfTRRllOOKJXCQtdFVuGu8VI6PniSAkI6c535yOWzsuS8HwIkN2ll+Wn7E="
language: cpp
cache: ccache
matrix:
fast_finish: true
include:
#Linux build
- os: linux
dist: trusty
language: cpp
env:
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#- LLVM_VERSION=3.8
sudo: false
cache:
apt: true
ccache: true
compiler:
#- clang
- gcc
addons:
coverity_scan:
project:
name: "openscenegraph/OpenSceneGraph"
description: "OpenSceneGraph build"
notification_email: robert@openscenegraph.com
build_command_prepend: "cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF -DBUILD_OSG_EXAMPLES=OFF ."
build_command: "make -j 4"
branch_pattern: coverity_scan
apt:
sources:
#- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
#- clang-3.8
- g++
- cmake
# # OSX build
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#
#
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF -DBUILD_OSG_APPLICATIONS=OFF -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF"
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then mkdir build && cd build && travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product $CMAKECMD_ARGS ../ ; fi
- if [ -f CMakeCache.txt ]; then make -j4 ; fi

View File

@@ -1,6 +1,6 @@
OpenSceneGraph Library 3.6.2 OpenSceneGraph Library 3.2.0
568 Contributors: 511 Contributors:
Firstname Surname Firstname Surname
----------------- -----------------
@@ -8,111 +8,103 @@ Robert Osfield
Don Burns Don Burns
Stephan Huber Stephan Huber
Paul Martz Paul Martz
Laurens Voerman
Farshid Lashkari
Mathias Fr<46>hlich Mathias Fr<46>hlich
Marco Jez Marco Jez
Farshid Lashkari
Wang Rui Wang Rui
Jean-S<>bastien Guay Jean-S<>bastien Guay
Ulrich Hertlein
Mike Weiblen Mike Weiblen
Sukender Ulrich Hertlein
Eric Wing Eric Wing
Sukender
Cedric Pinson Cedric Pinson
Brede Johansen Brede Johansen
Bob Kuehne Bob Kuehne
Wojciech Lewandowski
Michael Platings Michael Platings
Geoff Michel Geoff Michel
Wojciech Lewandowski
Eric Sokolowsky Eric Sokolowsky
David Callu David Callu
Colin McDonald
Trajce Nikolov Trajce Nikolov
Colin McDonald
Tim Moore Tim Moore
Martin Lavery Martin Lavery
Mattias Helsing Laurens Voerman
Jannik Heller Tree
Jason Beverage
Tree
Pjotr Svetachov
Luigi Calori Luigi Calori
Alberto Luaces
Mike Wittman Mike Wittman
Jan Peciva
Chris Hanson Chris Hanson
Roland Smeenk Roland Smeenk
Roger James Roger James
Jeremy Moles Jeremy Moles
Jason Beverage
Jan Peciva
J.P. Delport J.P. Delport
Andy Skinner Mattias Helsing
Magnus Kessler Magnus Kessler
David Fries David Fries
Tom Jolley Andy Skinner
Paul Melis Paul Melis
Jordi Torres Alberto Luaces
Luc Frauciel Luc Frauciel
Aurelien Albert Tom Jolley
Torben Dannhauer
Pavel Moloshtan Pavel Moloshtan
Brad Christiansen Brad Christiansen
Terry Welsh
Olaf Flebbe Olaf Flebbe
Mathieu Marache Mathieu Marache
Lionel Lagarde
Jason Daly Jason Daly
Art Tevs Art Tevs
Philip Lowman Philip Lowman
Per Fahlberg Per Fahlberg
Norman Vine Norman Vine
Chris Denham Terry Welsh
Sherman Wilcox
Serge Lages Serge Lages
Romano Jos<6F> Magacho da Silva Lionel Lagarde
Mourad Boufarguine Chris Denham
Alberto Farre Alberto Farre
Glenn Waldron Sherman Wilcox
Robert Michael
Mourad Boufarguine
Andr<EFBFBD> Garneau Andr<EFBFBD> Garneau
Adrian Egli Adrian Egli
Sebastian Messerschmidt
Randall Hopper
Kristofer Tingdahl
Jan Ciger
Ruben Lopez Ruben Lopez
Robert Michael Randall Hopper
Jan Ciger
Torben Dannhauer
Glenn Waldron
Gideon May Gideon May
Don Tidrow Don Tidrow
Aurelien Albert
Stephane Lamoliatte Stephane Lamoliatte
Romano Jos<6F> Magacho da Silva
Michael Gronager Michael Gronager
Martin Naylor Martin Naylor
Joakim Simonsson Joakim Simonsson
David Spilling David Spilling
Daniel Sj<53>lie Daniel Sj<53>lie
Bryan Thrall Bryan Thrall
Andreas Ekstrand
Rafa Gaitan
Mike Connell
Konstantin Matveyev
Fabien Lavignotte Fabien Lavignotte
Thomas Hogarth Andreas Ekstrand
Riccardo Corsi Mike Connell
Melchior Franz Melchior Franz
Johannes Baeuerle Johannes Baeuerle
Ravi Mathur Riccardo Corsi
Rafa Gaitan
Neil Hughes Neil Hughes
Martin Beckett Martin Beckett
Marc Helbling
Joran Jessurun Joran Jessurun
Gino van den Bergen Gino van den Bergen
Frederic Marmond
David Guthrie David Guthrie
Csaba Halasz Csaba Halasz
Cory Riddell Cory Riddell
Chuck Seberino Chuck Seberino
Boris Bralo Boris Bralo
Yefei He Yefei He
Thomas Hogarth
Sondra Iverson Sondra Iverson
Simon Julier Simon Julier
Rune Schmidt Jensen Rune Schmidt Jensen
Ralf Habacker
Rainer Oder Rainer Oder
Nico Kruithof Nico Kruithof
Martin Aumueller Martin Aumueller
@@ -120,24 +112,20 @@ Mario Valle
Lukasz Izdebski Lukasz Izdebski
Jorge Izquierdo Ciges Jorge Izquierdo Ciges
Gordon Tomlinson Gordon Tomlinson
Frederic Marmond
Frederic Bouvier Frederic Bouvier
Carlo Camporesi Carlo Camporesi
Bj<EFBFBD>rn Blissing Ben Discoe
Alexander Sinditskiy
Vladimir Chebaev
Thibault Genessay Thibault Genessay
Sasa Bistrovic Sasa Bistrovic
Raymond de Vries Ravi Mathur
Ralf Habacker
Pjotr Svetachov
Neil Groves Neil Groves
Mikhail Izmestev
Markus Trenkwalder Markus Trenkwalder
Loic Dachary Loic Dachary
Joseph Steel Joseph Steel
John Shue John Shue
Hartwig Wiesmann
Brad Colbert Brad Colbert
Ben Discoe
Vivek Rajan Vivek Rajan
Uwe Woessner Uwe Woessner
Tony Horrobin Tony Horrobin
@@ -145,7 +133,6 @@ Thom DeCarlo
Tatsuhiro Nishioka Tatsuhiro Nishioka
Tanguy Fautr<74> Tanguy Fautr<74>
Sean Spicer Sean Spicer
Ryan Kawicki
Richard Schmidt Richard Schmidt
Peter Hrenka Peter Hrenka
Paul de Repentigny Paul de Repentigny
@@ -157,17 +144,20 @@ Martins Innus
Maciej Krol Maciej Krol
Lilin Xiong Lilin Xiong
Leandro Motta Barros Leandro Motta Barros
Julien Valentin Jordi Torres
Johan Nouvel Johan Nouvel
Javier Taibo Hartwig Wiesmann
Donn Mielcarek Donn Mielcarek
Corbin Holtz Corbin Holtz
Blasius Czink Blasius Czink
Alexander Sinditskiy
Alexander Irion Alexander Irion
Wee See
Toshiyuki Takahei Toshiyuki Takahei
Sebastien Grignard Sebastien Grignard
Ryan Kawicki
Rudolf Wiedemann Rudolf Wiedemann
Romano Magacho
Mikhail Izmestev
Maria Ten Maria Ten
Liang Aibin Liang Aibin
Katharina Plugge Katharina Plugge
@@ -184,42 +174,34 @@ Bruce Clay
Bradley Anderegg Bradley Anderegg
Andreas Goebel Andreas Goebel
Alok Priyadarshi Alok Priyadarshi
Ali Botorabi Alberto Barbati
Alan Dickinson Alan Dickinson
Vladimir Shabanov Vladimir Shabanov
Tugkan Calapoglu Tugkan Calapoglu
Tim Daoust Tim Daoust
Sylvain Marie
Sohey Yamamoto Sohey Yamamoto
Sergey Leontyev Sergey Leontyev
Sebastian Messerschmidt
Santosh Gaikwad Santosh Gaikwad
Ryan Pavlik Ryan Pavlik
Robert Milharcic Robert Milharcic
Rene Molenaar Rene Molenaar
Piotr Domagalski Piotr Domagalski
Philippe Renon
Phil Atkin Phil Atkin
Pawel Ksiezopolski
Patrick Neary
Nathan Monteleone Nathan Monteleone
Miha Rav<61>elj
Miguel Escriva Miguel Escriva
Mattias Linde Mattias Linde
Mark Sciabica Mark Sciabica
Marcin Prus Marcin Prus
Lee Butler Lee Butler
Lars Nilsson
Konstantin Sinitsyn Konstantin Sinitsyn
Ken Sewell Ken Sewell
Julian Ortiz Julian Ortiz
Julen Garcia
John Kaniarz John Kaniarz
Johannes Scholz
Jim Vaughan Jim Vaughan
Jeremy Bell Jeremy Bell
Jaromir Vitek Jaromir Vitek
James French James French
Jaap Glas
Guillaume Millet Guillaume Millet
Gary Quinn Gary Quinn
Garrett Potts Garrett Potts
@@ -229,45 +211,44 @@ Doug McCorkle
Donald Cipperly Donald Cipperly
Don Leich Don Leich
Dietmar Funck Dietmar Funck
Colin Cochran
Christian Ruzicka
Christian Buchner Christian Buchner
Charles Cole Charles Cole
Blake Williams Blake Williams
Bj<EFBFBD>rn Hein
Aur<EFBFBD>lien Chatelain
Antoine Hue Antoine Hue
Andrew Bettison Andrew Bettison
Andreas Henne
Anders Backman Anders Backman
Ali Botorabi
Alexander Wiebel Alexander Wiebel
Alessandro Terenzi Alessandro Terenzi
Alberto Barbati
Zach Deedler Zach Deedler
Yuzhong Shen Yuzhong Shen
Wee See
Warren Macchi Warren Macchi
Vladimir Chebaev
Vincent Bourdier Vincent Bourdier
Terrex Terrex
Tassilo Glander Tassilo Glander
Sylvain Marie
Steve Lunsford Steve Lunsford
Stephane Simon Stephane Simon
Stephan Eilemann Stephan Eilemann
Stanislav Blinov Stanislav Blinov
Sergey Polischuk Sergey Polischuk
Roni Zanolli Raymond de Vries
Ralf Kern Ralf Kern
Piotr Gwiazdowski Piotr Gwiazdowski
Pierre Haritchabalet Pierre Haritchabalet
Perry Miller Perry Miller
Pawel Ksiezopolski
Paul Palumbo Paul Palumbo
Paul Obermeier Paul Obermeier
Nguyen Van Truong Nguyen Van Truong
Nathan Cournia Nathan Cournia
Morten Haukness Morten Haukness
Morn<EFBFBD> Pistorius Morn<EFBFBD> Pistorius
Michael Mc Donnell
Michael Henheffer Michael Henheffer
Michael Guerrero Michael Guerrero
Maya Leonard
Max Bandazian Max Bandazian
Mathias Fiedler Mathias Fiedler
Mathew May Mathew May
@@ -277,17 +258,20 @@ Martin Lambers
Martijn Kragtwijk Martijn Kragtwijk
Marius Heise Marius Heise
Marcin Hajder Marcin Hajder
Marcel Pursche
Lilith Bryant Lilith Bryant
Lars Nilsson
Kristofer Tingdahl
Kevin Moiule Kevin Moiule
Keith Steffen Keith Steffen
Julen Garcia
Joseph Winston Joseph Winston
John Aughey John Aughey
Johannes Scholz
Joachim Pouderoux Joachim Pouderoux
Jean-Christophe Lombardo Jean-Christophe Lombardo
Jan Klimke Javier Taibo
James Turner
James Moliere James Moliere
Jaap Glas
Igor Kravtchenko Igor Kravtchenko
Himar Carmona Himar Carmona
He Sicong He Sicong
@@ -295,37 +279,31 @@ Guy Volckaert
Gustavo Wagner Gustavo Wagner
Guillaume Taze Guillaume Taze
Guillaume Chouvenc Guillaume Chouvenc
Giuseppe Donvito
Gill Peacegood Gill Peacegood
Giampaolo Vigan<61>
Gerrick Bivins Gerrick Bivins
George Tarantilis George Tarantilis
Ferdi Smit Ferdi Smit
Eric Buehler
Eduardo Poyart Eduardo Poyart
Edgar Ellis Edgar Ellis
Dmitry Marakasov
Dimi Christopoulos Dimi Christopoulos
Diane Delall<EFBFBD>e Diane Delallée
David Longest David Longest
David Ergo David Ergo
Daniel Trstenjak Daniel Trstenjak
Craig Bosma Craig Bosma
Claus Scheiblauer Claus Scheiblauer
Christophe Loustaunau Christophe Loustaunau
Christian Kehl Christian Ruzicka
Bradley Baker Searles
Brad Anderegg Brad Anderegg
Aric Aumann Aric Aumann
Anish Thomas
Andrew Sampson Andrew Sampson
Andrew Lorino Andrew Lorino
Alexandre Amalric Alexandre Amalric
Aitor Moreno
Zbigniew Sroczynski Zbigniew Sroczynski
Yuri Vilmanis Yuri Vilmanis
Xin Li Xin Li
Wang Lam Wang Lam
Wand Rui
Walter J. Altice Walter J. Altice
Volker Walkiewicz Volker Walkiewicz
Vladimir Vukicevic Vladimir Vukicevic
@@ -339,37 +317,29 @@ Valeriy Dubov
Vaclav Bilek Vaclav Bilek
Tyge L<>vset Tyge L<>vset
Troy Yee Troy Yee
Torben Dannahauer
Tony Vasile
Tomas Hogarth Tomas Hogarth
Tomas Hnilica Tomas Hnilica
Todd Furlong Todd Furlong
Tobias Ottenweller Tobias Ottenweller
Tino Schwarze Tino Schwarze
Tim George
Thorsten Brehm Thorsten Brehm
Thomas Weidner Thomas Weidner
Tan Dunning Tan Dunning
Tamer Fahmy Tamer Fahmy
Stewart Andreason Stewart Andreason
Steven Thomas Steven Thomas
Stephan Wenglorz
Simon Hammett Simon Hammett
Simon Carmody Simon Carmody
Simon Buckley Simon Buckley
Sid Byce Sid Byce
Shuxing Xiao Shuxing Xiao
Shane Arnott Shane Arnott
Sergey Kurdakov
Sebastien Kuntz Sebastien Kuntz
Sandro Mani
Ruth Lang Ruth Lang
Ruben The
Ruben Smelik Ruben Smelik
Ross Anderson Ross Anderson
Ronny Krueger Ronny Krueger
Ronald van Maarseveen Ronald van Maarseveen
Romain Ouabdelkader
Romain Charbit Romain Charbit
Rocco Martino Rocco Martino
Robert Swain Robert Swain
@@ -378,7 +348,6 @@ Rob Radtke
Rob Bloemkool Rob Bloemkool
Rick Pingry Rick Pingry
Rick Appleton Rick Appleton
Remo Eichenberger
Reinhard Sainitzer Reinhard Sainitzer
Rein Kadijk Rein Kadijk
Ragnar Hammarqvist Ragnar Hammarqvist
@@ -392,11 +361,9 @@ Philip Lamb
Petr Salinger Petr Salinger
Peter Bear Peter Bear
Peter Amstutz Peter Amstutz
Per Nordqvist
Paul Idstein Paul Idstein
Paul Fredrikson Paul Fredrikson
Paul Fotheringham Paul Fotheringham
Paul Cheyrou-Lagreze
Pau Garcia Pau Garcia
Patrick Hartling Patrick Hartling
Parag Chaudhur Parag Chaudhur
@@ -406,28 +373,22 @@ Orhun Birsoy
Oren Fromberg Oren Fromberg
Oliver Neumann Oliver Neumann
Ole-Morten Duesund Ole-Morten Duesund
Ognjen Kostic
Nicolas Brodu Nicolas Brodu
Nick Thu
Nick Black Nick Black
Mojtaba Fathi Mojtaba Fathi
Mirko Viviani Mirko Viviani
Mikkel Gj<EFBFBD>l Mikkel Gjøl
Mike Krus
Mike Garrity Mike Garrity
Mick Thu Miha Ravsel
Michal Durkovic
Michael Schanne
Michael Polak Michael Polak
Michael Morrison Michael Morrison
Michael Logan Michael Logan
Michael Kapelko Michael Kapelko
Michael Bach Jensen Michael Bach Jensen
Maya Thu
Maya Leonard
Max Rhiener Max Rhiener
Max Behensky Max Behensky
Mauricio Hofmam Mauricio Hofmam
Matthias Helsing
Matthew May Matthew May
Matthew Johnson-Roberson Matthew Johnson-Roberson
Matt Green Matt Green
@@ -440,19 +401,20 @@ Martin Innus
Martin Beck Martin Beck
Marius Kintel Marius Kintel
Mario Guimaraes Mario Guimaraes
Marcus Hein
Marco Thu
Marco Sciabica Marco Sciabica
Marco Lehmann Marco Lehmann
Marcel Pursche
Maik Keller
Lukas Diduch Lukas Diduch
Louis Hamilton Louis Hamilton
Likasz Izebski
Lewis Harmon Lewis Harmon
Leigh Stivers Leigh Stivers
Laurence Muller Laurence Muller
Laura Cerritelli Laura Cerritelli
Lars Nillson
Kyle Centers Kyle Centers
Kristopher Bixler Kristopher Bixler
Konstantin Matveyev
Kim Seokhwan Kim Seokhwan
Kim Bale Kim Bale
Karsten Weiss Karsten Weiss
@@ -463,24 +425,20 @@ Juergen Rensen
Juan Manuel Alvarez Juan Manuel Alvarez
Juan Hernando Juan Hernando
Josh Portway Josh Portway
Jonathan Greig
John Tan John Tan
John Hedström
John Grant John Grant
John Farrier
John Donovan John Donovan
John Davis John Davis
John Cummings John Cummings
John Argentieri John Argentieri
Joe Thompson
Joan Abadie Joan Abadie
Jim Brooks Jim Brooks
Jeroen den Dekker Jeroen den Dekker
Jeffrey Kinross
Jay Zuckerman Jay Zuckerman
Jason Howlett Jason Howlett
Jason Ballenger Jason Ballenger
Jamie Robertson Jan Klimke
James Turner
James Killian James Killian
James Athey James Athey
J.E. Hoffmann J.E. Hoffmann
@@ -493,7 +451,6 @@ Gregory Jaegy
Graeme Harkness Graeme Harkness
Gian Lorenzetto Gian Lorenzetto
George Papagiannakis George Papagiannakis
Geoff Thu
Galen Faidley Galen Faidley
Frida Schlaug Frida Schlaug
Frederic Smith Frederic Smith
@@ -508,8 +465,6 @@ Ferdinand Cornelissen
Fajran Iman Fajran Iman
Fabien Dachicourt Fabien Dachicourt
Erik Johnson Erik Johnson
Eric Thu
Eric Buehler
Eduardo Alberto Eduardo Alberto
Edmond Gheury Edmond Gheury
Ed Ralston Ed Ralston
@@ -517,7 +472,6 @@ Duvan Cope
Duncan Cavens Duncan Cavens
Drew Whitehouse Drew Whitehouse
Douglas A. Pouk Douglas A. Pouk
Dmitriy Ogalcev
Dean Iverson Dean Iverson
David Jung David Jung
Danny Valente Danny Valente
@@ -525,26 +479,22 @@ Daniel Stien
Dan Minor Dan Minor
C<EFBFBD>sar L. B. Silveira C<EFBFBD>sar L. B. Silveira
Cyril Brulebois Cyril Brulebois
Curtis Rubel
Cory Slep
Cl<EFBFBD>ment B<>sch
Clay Fowler Clay Fowler
Claus Steuer
Chuck Sembroski Chuck Sembroski
Christopher Blaesius Christopher Blaesius
Christopher Baker
Christophe Herreman Christophe Herreman
Christian Noon Christian Noon
Christian Kaser Christian Kaser
Christian Ehrlicher Christian Ehrlicher
Chris McGlone Chris McGlone
Chris Djali
Carlos Garcea Carlos Garcea
Bryce Eldridge Bryce Eldridge
Bruno Herbelin Bruno Herbelin
Brian Keener Brian Keener
Brede Thu
Brandon Hamm Brandon Hamm
Bora Utka
Bj<EFBFBD>rn Hein
Bjorn Blissing
Bill Prendergast Bill Prendergast
Bernardt Duvenhage Bernardt Duvenhage
Benoit Laniel Benoit Laniel
@@ -552,23 +502,16 @@ Benjamin Wasty
Ben van Basten Ben van Basten
Bart Gallet Bart Gallet
Axel Volley Axel Volley
Arjun Ramamurthy
Anthousis Andreadis Anthousis Andreadis
Anna Sokol
Andy Preece Andy Preece
Andrew Reyonolds Andrew Reyonolds
Andreas Roth Andreas Roth
Andreas Jochens Andreas Jochens
Andre Normann Andre Normann
Alois Wismer
Almalric Alexandre Almalric Alexandre
Allen Bierbaum Allen Bierbaum
Alexey Pavlov
Alberto Jaspe Alberto Jaspe
Alan Purvis Alan Purvis
Alan Ott Alan Ott
Alan Harris Alan Harris
Adrien Grandemange
Adrian Clark
Adam Richard Adam Richard
Abhishek Bansal

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# Check for availability of atomic operations # Check for availability of atomic operations
# This module defines # This module defines
# OPENTHREADS_HAVE_ATOMIC_OPS # OPENTHREADS_HAVE_ATOMIC_OPS
@@ -15,143 +15,123 @@ IF (OPENTHREADS_ATOMIC_USE_MUTEX)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1) SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ELSE() ELSE()
# as the test does not work for IOS hardcode the ATOMIC implementation
IF(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR OR OSG_BUILD_PLATFORM_IPHONE)
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_SUN 0)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 0)
SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1) INCLUDE(CheckCXXSourceRuns)
ELSE() # Do step by step checking,
INCLUDE(CheckCXXSourceRuns) CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
# Do step by step checking, int main()
CHECK_CXX_SOURCE_RUNS(" {
#include <cstdlib> unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
int main() if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
{ return EXIT_FAILURE;
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr)) return EXIT_SUCCESS;
return EXIT_FAILURE; }
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
return EXIT_SUCCESS; CHECK_CXX_SOURCE_RUNS("
} #include <stdlib.h>
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
CHECK_CXX_SOURCE_RUNS(" int main(int, const char**)
#include <stdlib.h> {
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
int main(int, const char**) if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
{ return EXIT_FAILURE;
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr)) return EXIT_SUCCESS;
return EXIT_FAILURE; }
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
return EXIT_SUCCESS; CHECK_CXX_SOURCE_RUNS("
} #include <atomic.h>
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS) #include <cstdlib>
CHECK_CXX_SOURCE_RUNS(" int main(int, const char**)
#include <atomic.h> {
#include <cstdlib> uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
int main(int, const char**) if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
{ return EXIT_FAILURE;
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr)) return EXIT_SUCCESS;
return EXIT_FAILURE; }
" _OPENTHREADS_ATOMIC_USE_SUN)
return EXIT_SUCCESS; CHECK_CXX_SOURCE_RUNS("
} #include <windows.h>
" _OPENTHREADS_ATOMIC_USE_SUN) #include <intrin.h>
#include <cstdlib>
CHECK_CXX_SOURCE_RUNS(" #pragma intrinsic(_InterlockedAnd)
#include <windows.h> #pragma intrinsic(_InterlockedOr)
#include <intrin.h> #pragma intrinsic(_InterlockedXor)
#include <cstdlib>
#pragma intrinsic(_InterlockedAnd) int main(int, const char**)
#pragma intrinsic(_InterlockedOr) {
#pragma intrinsic(_InterlockedXor) volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
int main(int, const char**) InterlockedIncrement(&value);
{ MemoryBarrier();
volatile long value = 0; InterlockedDecrement(&value);
long data = 0;
long* volatile ptr = &data;
InterlockedIncrement(&value); if (0 != InterlockedCompareExchange(&value, 1, 0))
MemoryBarrier(); return EXIT_FAILURE;
InterlockedDecrement(&value);
if (0 != InterlockedCompareExchange(&value, 1, 0)) if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE; return EXIT_FAILURE;
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr)) return EXIT_SUCCESS;
return EXIT_FAILURE; }
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
return EXIT_SUCCESS; CHECK_CXX_SOURCE_RUNS("
} #include <libkern/OSAtomic.h>
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
CHECK_CXX_SOURCE_RUNS(" int main()
#include <libkern/OSAtomic.h> {
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
int main() OSAtomicIncrement32(&value);
{ OSMemoryBarrier();
volatile int32_t value = 0; OSAtomicDecrement32(&value);
long data = 0; OSAtomicCompareAndSwapInt(value, 1, &value);
long * volatile ptr = &data; OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
OSAtomicIncrement32(&value); " _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF()
# MinGW can set both WIN32_INTERLOCKED and GCC_BUILTINS to true which results in compliation errors
IF (_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
# In this case we prefer the GCC_BUILTINS
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
ENDIF()
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@@ -9,19 +9,19 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
SET(MY_PATH_INCLUDE ) SET(MY_PATH_INCLUDE )
SET(MY_PATH_LIB ) SET(MY_PATH_LIB )
FOREACH( MYPATH ${SEARCHPATHLIST} ) FOREACH( MYPATH ${SEARCHPATHLIST} )
SET(MY_PATH_INCLUDE ${MY_PATH_INCLUDE} ${MYPATH}/include) SET(MY_PATH_INCLUDE ${MY_PATH_INCLUDE} ${MYPATH}/include)
SET(MY_PATH_LIB ${MY_PATH_LIB} ${MYPATH}/lib) SET(MY_PATH_LIB ${MY_PATH_LIB} ${MYPATH}/lib)
ENDFOREACH( MYPATH ${SEARCHPATHLIST} ) ENDFOREACH( MYPATH ${SEARCHPATHLIST} )
FIND_PATH("${DEPNAME}_INCLUDE_DIR" ${INCLUDEFILE} FIND_PATH("${DEPNAME}_INCLUDE_DIR" ${INCLUDEFILE}
${MY_PATH_INCLUDE} ${MY_PATH_INCLUDE}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
MARK_AS_ADVANCED("${DEPNAME}_INCLUDE_DIR") MARK_AS_ADVANCED("${DEPNAME}_INCLUDE_DIR")
#MESSAGE( " ${DEPNAME}_INCLUDE_DIR --> ${${DEPNAME}_INCLUDE_DIR}<--") #MESSAGE( " ${DEPNAME}_INCLUDE_DIR --> ${${DEPNAME}_INCLUDE_DIR}<--")
SET(LIBRARY_NAMES "") SET(LIBRARY_NAMES "")
FOREACH(LIBNAME ${LIBRARY_NAMES_BASE}) FOREACH(LIBNAME ${LIBRARY_NAMES_BASE})
LIST(APPEND LIBRARY_NAMES "${LIBNAME}${EXSUFFIX}") LIST(APPEND LIBRARY_NAMES "${LIBNAME}${EXSUFFIX}")
@@ -35,7 +35,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
FOREACH(LIBNAME ${LIBRARY_NAMES_BASE}) FOREACH(LIBNAME ${LIBRARY_NAMES_BASE})
LIST(APPEND LIBRARY_NAMES_DEBUG "${LIBNAME}${DEBUGSUFFIX}${EXSUFFIX}") LIST(APPEND LIBRARY_NAMES_DEBUG "${LIBNAME}${DEBUGSUFFIX}${EXSUFFIX}")
ENDFOREACH(LIBNAME) ENDFOREACH(LIBNAME)
FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG" FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG"
NAMES ${LIBRARY_NAMES_DEBUG} NAMES ${LIBRARY_NAMES_DEBUG}
PATHS ${MY_PATH_LIB} PATHS ${MY_PATH_LIB}
NO_DEFAULT_PATH NO_DEFAULT_PATH
@@ -49,13 +49,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
MESSAGE("-- Warning Debug ${DEPNAME} not found, using: ${${DEPNAME}_LIBRARY}") MESSAGE("-- Warning Debug ${DEPNAME} not found, using: ${${DEPNAME}_LIBRARY}")
SET(${DEPNAME}_LIBRARY_DEBUG "${${DEPNAME}_LIBRARY}") SET(${DEPNAME}_LIBRARY_DEBUG "${${DEPNAME}_LIBRARY}")
ENDIF(NOT ${DEPNAME}_LIBRARY_DEBUG) ENDIF(NOT ${DEPNAME}_LIBRARY_DEBUG)
SET(${DEPNAME}_LIBRARIES debug ${${DEPNAME}_LIBRARY_DEBUG} optimized ${${DEPNAME}_LIBRARY} )
ENDIF(${DEPNAME}_INCLUDE_DIR AND ${DEPNAME}_LIBRARY) ENDIF(${DEPNAME}_INCLUDE_DIR AND ${DEPNAME}_LIBRARY)
ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX) ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX)
@@ -64,21 +58,21 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
################################################################################################ ################################################################################################
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN) MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
FIND_DEPENDENCY(TIFF tiff.h "libtiff;tiff" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;freetype27;freetype271;" ${OSG_3RDPARTY_BIN} "d" "") FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;" ${OSG_3RDPARTY_BIN} "d" "")
IF(FREETYPE_FOUND) IF(FREETYPE_FOUND)
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack #forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE) SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE) SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2) MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_FOUND) ENDIF(FREETYPE_FOUND)
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib;libcurl_imp" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i") FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i")
FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "")
IF(GLUT_FOUND) IF(GLUT_FOUND)
#forcing subsequent FindGlut stuff to not search for other variables.... kind of a hack #forcing subsequent FindGlut stuff to not search for other variables.... kind of a hack
SET(GLUT_glut_LIBRARY ${GLUT_LIBRARY} CACHE FILEPATH "") SET(GLUT_glut_LIBRARY ${GLUT_LIBRARY} CACHE FILEPATH "")
MARK_AS_ADVANCED(GLUT_glut_LIBRARY) MARK_AS_ADVANCED(GLUT_glut_LIBRARY)
ENDIF(GLUT_FOUND) ENDIF(GLUT_FOUND)
@@ -87,18 +81,16 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
IF(ZLIB_FOUND) IF(ZLIB_FOUND)
FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15;libpng16" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15;libpng16" ${OSG_3RDPARTY_BIN} "D" "")
IF(PNG_FOUND) IF(PNG_FOUND)
#forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack #forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack
SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "") SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "")
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR) MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
ENDIF(PNG_FOUND) ENDIF(PNG_FOUND)
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
FIND_DEPENDENCY(LIBXML2 libxml2 "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
# CMakes default module to find libxml2 will not find the in
FIND_DEPENDENCY(LIBXML2 libxml/xpath.h "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
IF(LIBXML2_FOUND) IF(LIBXML2_FOUND)
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack # The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "LibXML2 library for collada" FORCE) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
# SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE) SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
ENDIF(LIBXML2_FOUND) ENDIF(LIBXML2_FOUND)
#FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX) #FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX)
FIND_Package(NVTT) FIND_Package(NVTT)
@@ -112,7 +104,7 @@ ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
# this is code for handling optional 3RDPARTY usage # this is code for handling optional 3RDPARTY usage
################################################################################################ ################################################################################################
OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike or Torbens prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON) OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON)
IF(USE_3RDPARTY_BIN) IF(USE_3RDPARTY_BIN)
# Check Architecture # Check Architecture
@@ -140,7 +132,7 @@ IF(USE_3RDPARTY_BIN)
SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdParty_win32binaries_vs90sp1") SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdParty_win32binaries_vs90sp1")
ENDIF() ENDIF()
ENDIF(NOT EXISTS ${TEST_3RDPARTY_DIR}) ENDIF(NOT EXISTS ${TEST_3RDPARTY_DIR})
SET(ACTUAL_3RDPARTY_DIR "${TEST_3RDPARTY_DIR}" CACHE PATH "Location of 3rdparty dependencies") SET(ACTUAL_3RDPARTY_DIR "${TEST_3RDPARTY_DIR}" CACHE PATH "Location of 3rdparty dependencies")
SET(ACTUAL_3DPARTY_DIR "${ACTUAL_3RDPARTY_DIR}") # kept for backcompatibility SET(ACTUAL_3DPARTY_DIR "${ACTUAL_3RDPARTY_DIR}") # kept for backcompatibility
IF(EXISTS ${ACTUAL_3RDPARTY_DIR}) IF(EXISTS ${ACTUAL_3RDPARTY_DIR})

View File

@@ -1,20 +1,22 @@
# Locate Apple AVFoundation (next-generation QTKit) # Locate Apple AVFoundation (next-generation QTKit)
# This module defines # This module defines
# AV_FOUNDATION_LIBRARY # AV_FOUNDATION_LIBRARY
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal # AV_FOUNDATION_FOUND, if false, do not try to link to gdal
# AV_FOUNDATION_INCLUDE_DIR, where to find the headers
# #
# $AV_FOUNDATION_DIR is an environment variable that would # $AV_FOUNDATION_DIR is an environment variable that would
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR # correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
# #
# Created by Stephan Maximilian Huber # Created by Stephan Maximilian Huber
IF(APPLE) IF(APPLE)
FIND_PATH(AV_FOUNDATION_INCLUDE_DIR AVFoundation/AVFoundation.h)
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation) FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
ENDIF() ENDIF()
SET(AV_FOUNDATION_FOUND "NO") SET(AV_FOUNDATION_FOUND "NO")
IF(AV_FOUNDATION_LIBRARY) IF(AV_FOUNDATION_LIBRARY AND AV_FOUNDATION_INCLUDE_DIR)
SET(AV_FOUNDATION_FOUND "YES") SET(AV_FOUNDATION_FOUND "YES")
ENDIF() ENDIF()
@@ -30,9 +32,11 @@ ELSE()
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG # AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
# so check the SDK-setting # so check the SDK-setting
IF(OSG_OSX_VERSION VERSION_LESS 10.8) IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
MESSAGE("AVFoundation disabled for SDK < 10.8") # nothing special here ;-)
SET(AV_FOUNDATION_FOUND "NO") ELSE()
MESSAGE("AVFoundation disabled for SDK < 10.8")
SET(AV_FOUNDATION_FOUND "NO")
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

12
CMakeModules/FindAsio.cmake Normal file → Executable file
View File

@@ -1,9 +1,9 @@
# Locate ASIO-headers (http://think-async.com/Asio) # Locate ASIO-headers (http://think-async.com/Asio)
# This module defines # This module defines
# ASIO_FOUND, if false, do not try to link to gdal # ASIO_FOUND, if false, do not try to link to gdal
# ASIO_INCLUDE_DIR, where to find the headers # ASIO_INCLUDE_DIR, where to find the headers
# #
# Created by Stephan Maximilian Huber # Created by Stephan Maximilian Huber
FIND_PATH(ASIO_INCLUDE_DIR FIND_PATH(ASIO_INCLUDE_DIR
NAMES NAMES
@@ -14,9 +14,7 @@ FIND_PATH(ASIO_INCLUDE_DIR
) )
SET(ASIO_FOUND "NO") SET(ASIO_FOUND "NO")
IF(ASIO_INCLUDE_DIR) FIND_PACKAGE( Boost 1.37 )
FIND_PACKAGE( Boost 1.37 ) IF(Boost_FOUND AND ASIO_INCLUDE_DIR)
IF(Boost_FOUND) SET(ASIO_FOUND "YES")
SET(ASIO_FOUND "YES")
ENDIF()
ENDIF() ENDIF()

View File

@@ -11,50 +11,36 @@
# $COLLADA_DIR is an environment variable that would # $COLLADA_DIR is an environment variable that would
# correspond to the ./configure --prefix=$COLLADA_DIR # correspond to the ./configure --prefix=$COLLADA_DIR
# #
# Created by Robert Osfield. # Created by Robert Osfield.
# Check if COLLADA_DIR is set, otherwise use ACTUAL_3DPARTY_DIR: # Check if COLLADA_DIR is set, otherwise use ACTUAL_3DPARTY_DIR:
SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} ) SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )
IF ( COLLADA_ENV_VAR_AVAILABLE ) IF ( COLLADA_ENV_VAR_AVAILABLE )
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE) SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ELSE () ELSE ( COLLADA_ENV_VAR_AVAILABLE )
SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE) SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ENDIF() ENDIF( COLLADA_ENV_VAR_AVAILABLE )
IF(APPLE) IF(APPLE)
SET(COLLADA_BUILDNAME "mac") SET(COLLADA_BUILDNAME "mac")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF(MINGW) ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw") SET(COLLADA_BUILDNAME "mingw")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) ELSEIF(MSVC12)
ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 )
SET(COLLADA_BUILDNAME "vc14")
SET(COLLADA_BOOST_BUILDNAME "vc140")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(COLLADA_BUILDNAME "vc12") SET(COLLADA_BUILDNAME "vc12")
SET(COLLADA_BOOST_BUILDNAME "vc120") ELSEIF(MSVC11)
ELSEIF(MSVC_VERSION EQUAL 1700)
SET(COLLADA_BUILDNAME "vc11") SET(COLLADA_BUILDNAME "vc11")
SET(COLLADA_BOOST_BUILDNAME "vc110") ELSEIF(MSVC10)
ELSEIF(MSVC_VERSION EQUAL 1600)
SET(COLLADA_BUILDNAME "vc10") SET(COLLADA_BUILDNAME "vc10")
SET(COLLADA_BOOST_BUILDNAME "vc100") ELSEIF(MSVC90)
ELSEIF(MSVC_VERSION EQUAL 1500)
SET(COLLADA_BUILDNAME "vc9") SET(COLLADA_BUILDNAME "vc9")
SET(COLLADA_BOOST_BUILDNAME "vc90") ELSEIF(MSVC80)
ELSEIF(MSVC_VERSION EQUAL 1400)
SET(COLLADA_BUILDNAME "vc8") SET(COLLADA_BUILDNAME "vc8")
SET(COLLADA_BOOST_BUILDNAME "vc80") ELSE(APPLE)
ELSE()
SET(COLLADA_BUILDNAME "linux") SET(COLLADA_BUILDNAME "linux")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) ENDIF(APPLE)
ENDIF()
IF(${CMAKE_VS_PLATFORM_TOOLSET})
string(REPLACE "v" "vc" COLLADA_BOOST_BUILDNAME ${CMAKE_VS_PLATFORM_TOOLSET})
ENDIF()
FIND_PATH(COLLADA_INCLUDE_DIR dae.h FIND_PATH(COLLADA_INCLUDE_DIR dae.h
@@ -67,19 +53,10 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
/usr/local/include /usr/local/include
/usr/local/include/colladadom /usr/local/include/colladadom
/usr/local/include/collada-dom /usr/local/include/collada-dom
/usr/local/include/collada-dom2.5
/usr/local/include/collada-dom2.4
/usr/local/include/collada-dom2.2
/opt/local/include/collada-dom /opt/local/include/collada-dom
/opt/local/include/collada-dom2.5
/opt/local/include/collada-dom2.4
/opt/local/include/collada-dom2.2
/usr/include/ /usr/include/
/usr/include/colladadom /usr/include/colladadom
/usr/include/collada-dom /usr/include/collada-dom
/usr/include/collada-dom2.5
/usr/include/collada-dom2.4
/usr/include/collada-dom2.2
/sw/include # Fink /sw/include # Fink
/opt/local/include # DarwinPorts /opt/local/include # DarwinPorts
/opt/csw/include # Blastwave /opt/csw/include # Blastwave
@@ -88,17 +65,16 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
${ACTUAL_3DPARTY_DIR}/include ${ACTUAL_3DPARTY_DIR}/include
) )
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.5-dp collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt collada-dom2.4-dp collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4 ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
${COLLADA_DOM_ROOT}
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4 $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
$ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR} $ENV{COLLADA_DIR}
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/opt/local/Library/Frameworks #macports /opt/local/Library/Frameworks #macports
/usr/local/lib /usr/local/lib
/usr/local/lib64 /usr/local/lib64
@@ -112,11 +88,10 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
${ACTUAL_3DPARTY_DIR}/lib ${ACTUAL_3DPARTY_DIR}/lib
) )
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.5-dp-d collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt-d collada-dom2.4-dp-d collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt-d NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
${COLLADA_DOM_ROOT}
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
$ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR}/lib-dbg
@@ -136,7 +111,7 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
${ACTUAL_3DPARTY_DIR}/lib ${ACTUAL_3DPARTY_DIR}/lib
) )
FIND_LIBRARY(COLLADA_STATIC_LIBRARY FIND_LIBRARY(COLLADA_STATIC_LIBRARY
NAMES libcollada14dom21-s libcollada14dom22-s libcollada14dom.a NAMES libcollada14dom21-s libcollada14dom22-s libcollada14dom.a
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4 ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
@@ -159,7 +134,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY
${ACTUAL_3DPARTY_DIR}/lib ${ACTUAL_3DPARTY_DIR}/lib
) )
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd libcollada14dom22-sd libcollada14dom-d.a NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd libcollada14dom22-sd libcollada14dom-d.a
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
@@ -198,19 +173,10 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
ENDIF(WIN32) ENDIF(WIN32)
ENDIF(LIBXML2_FOUND) ENDIF(LIBXML2_FOUND)
FIND_PACKAGE(ZLIB) FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND) IF (ZLIB_FOUND)
IF (ZLIB_LIBRARY_RELEASE) SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY_RELEASE}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_RELEASE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_RELEASE)
IF (ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY_DEBUG}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${COLLADA_ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_DEBUG)
ELSE(ZLIB_FOUND) ELSE(ZLIB_FOUND)
IF(WIN32) IF(WIN32)
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
@@ -276,7 +242,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_63 NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -284,7 +250,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63 NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -292,7 +258,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_63 NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -300,7 +266,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63 NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -311,20 +277,6 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
SET(COLLADA_FOUND "NO") SET(COLLADA_FOUND "NO")
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY) IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
IF (COLLADA_INCLUDE_DIR) IF (COLLADA_INCLUDE_DIR)
SET(COLLADA_FOUND "YES") SET(COLLADA_FOUND "YES")
ENDIF(COLLADA_INCLUDE_DIR)
FIND_PATH(COLLADA_INCLUDE_DOMANY_DIR 1.4/dom/domAny.h ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
${COLLADA_INCLUDE_DIR}
)
IF (COLLADA_INCLUDE_DOMANY_DIR)
SET(COLLADA_DOM_2_4_OR_LATER TRUE)
ELSEIF()
SET(COLLADA_DOM_2_4_OR_LATER FALSE)
ENDIF()
ENDIF()
ENDIF()

View File

@@ -1,33 +0,0 @@
# Finds EGL header and library
#
# This script defines the following:
# EGL_FOUND // Set to TRUE if EGL is found
# EGL_INCLUDE_DIR // Parent directory of directory EGL/egl.h header.
#
# EGL_DIR can be set as an environment variable or a CMake variable,
# to the parent directory of the EGL header.
#
FIND_PATH( EGL_INCLUDE_DIR
NAMES EGL/egl.h
HINTS ENV EGL_DIR
)
FIND_LIBRARY(EGL_LIBRARY
NAMES EGL
HINTS ENV EGL_DIR
PATH_SUFFIXES lib
)
# handle the QUIETLY and REQUIRED arguments and set
# EGL_FOUND to TRUE as appropriate
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL
REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR)
MARK_AS_ADVANCED(
EGL_INCLUDE_DIR
EGL_LIBRARY
)

View File

@@ -9,12 +9,7 @@
# correspond to the ./configure --prefix=$FBX_DIR # correspond to the ./configure --prefix=$FBX_DIR
IF(APPLE) IF(APPLE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
SET(FBX_LIBDIR "clang")
else()
SET(FBX_LIBDIR "gcc4/ub") SET(FBX_LIBDIR "gcc4/ub")
endif()
ELSEIF(CMAKE_COMPILER_IS_GNUCXX) ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBDIR "gcc4") SET(FBX_LIBDIR "gcc4")
ELSEIF(MSVC80) ELSEIF(MSVC80)
@@ -23,12 +18,8 @@ ELSEIF(MSVC90)
SET(FBX_LIBDIR "vs2008") SET(FBX_LIBDIR "vs2008")
ELSEIF(MSVC10) ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010") SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11) ELSEIF(MSVC11 OR MSVC_VERSION>1700)
SET(FBX_LIBDIR "vs2012") SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
SET(FBX_LIBDIR "vs2015")
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
@@ -41,43 +32,21 @@ ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86) SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
ENDIF() ENDIF()
#try to use 2015.1 or 2014.2 version
IF(APPLE) IF(APPLE)
SET(FBX_LIBNAME "fbxsdk") SET(FBX_LIBNAME "libfbxsdk")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX) ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk") SET(FBX_LIBNAME "fbxsdk")
ELSE() ELSE()
OPTION(FBX_SHARED OFF) SET(FBX_LIBNAME "libfbxsdk-md")
IF(FBX_SHARED)
SET(FBX_LIBNAME "libfbxsdk")
ELSE()
SET(FBX_LIBNAME "libfbxsdk-md")
ENDIF()
ENDIF() ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d) SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
"/Applications/Autodesk/FBX\ SDK/2018.0" /Applications/Autodesk/FBXSDK20141
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
"/Applications/Autodesk/FBX SDK/2017.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
/Applications/Autodesk/FBXSDK20151
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
"/Applications/Autodesk/FBX/FBX SDK/2014.2"
/Applications/Autodesk/FBXSDK20142
) )
# search for headers & debug/release libraries # search for headers & debug/release libraries
@@ -105,22 +74,21 @@ ELSE()
ENDIF() ENDIF()
IF(NOT FBX_FOUND) IF(NOT FBX_FOUND)
#try to use 2014.1 version #try to use 2013.3 version
IF(APPLE) IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2014.1") SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX) ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2014.1") SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSE() ELSE()
SET(FBX_LIBNAME "fbxsdk-2014.1") SET(FBX_LIBNAME "fbxsdk-2013.3-md")
ENDIF() ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d) SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1" $ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1" $ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3
"/Applications/Autodesk/FBX/FBX SDK/2014.1"
/Applications/Autodesk/FBXSDK20141 /Applications/Autodesk/FBXSDK20141
) )
@@ -142,42 +110,3 @@ IF(NOT FBX_FOUND)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(NOT FBX_FOUND)
#try to use 2013.3 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSE()
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3"
"/Applications/Autodesk/FBX/FBX SDK/2013.3"
/Applications/Autodesk/FBXSDK20133
)
# search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "include")
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()
SET(FBX_FOUND "NO")
ENDIF()
ENDIF()

View File

@@ -12,10 +12,10 @@
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>" #In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
#In OSG ffmpeg plugin, we used "#include <header.h>" for compatibility with old version of ffmpeg #In OSG ffmpeg plugin, we used "#include <header.h>" for compatibility with old version of ffmpeg
#With the new version of FFmpeg, a file named "time.h" was added that breaks compatibility with the old version of ffmpeg. #With the new version of FFmpeg, a file named "time.h" was added that breaks compatability with the old version of ffmpeg.
#We have to search the path which contain the header.h (useful for old version) #We have to search the path which contain the header.h (usefull for old version)
#and search the path which contain the libname/header.h (useful for new version) #and search the path which contain the libname/header.h (usefull for new version)
#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code) #Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
# (in new version case, use by ffmpeg header) # (in new version case, use by ffmpeg header)
@@ -32,8 +32,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS PATHS
${FFMPEG_ROOT}/include ${FFMPEG_ROOT}/include
$ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR}/include
${FFMPEG_ROOT}
$ENV{FFMPEG_DIR}
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local/include /usr/local/include
@@ -51,8 +49,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS PATHS
${FFMPEG_ROOT}/include ${FFMPEG_ROOT}/include
$ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR}/include
${FFMPEG_ROOT}
$ENV{FFMPEG_DIR}
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local/include /usr/local/include
@@ -71,8 +67,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS PATHS
${FFMPEG_ROOT}/lib ${FFMPEG_ROOT}/lib
$ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/lib
${FFMPEG_ROOT}/lib${shortname}
$ENV{FFMPEG_DIR}/lib${shortname}
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local/lib /usr/local/lib
@@ -96,7 +90,7 @@ ENDMACRO(FFMPEG_FIND)
SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG") SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
# find stdint.h # find stdint.h
IF(MSVC) IF(WIN32)
FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
PATHS PATHS
@@ -129,14 +123,11 @@ FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h) FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h) FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
FFMPEG_FIND(LIBAVUTIL avutil avutil.h) FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
FFMPEG_FIND(LIBSWRESAMPLE swresample swresample.h)
FFMPEG_FIND(LIBAVRESAMPLE avresample avresample.h)
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here. FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
SET(FFMPEG_FOUND "NO") SET(FFMPEG_FOUND "NO")
# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional. # Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
AND ( FFMPEG_LIBSWRESAMPLE_FOUND OR FFMPEG_LIBAVRESAMPLE_FOUND ) )
SET(FFMPEG_FOUND "YES") SET(FFMPEG_FOUND "YES")

View File

@@ -9,15 +9,6 @@
# #
# Created by Robert Osfield. # Created by Robert Osfield.
# prefer FindFLTK from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindFLTK.cmake)
include(${CMAKE_ROOT}/Modules/FindFLTK.cmake)
if(FLTK_FOUND)
return()
endif()
endif()
FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h
$ENV{FLTK_DIR}/include $ENV{FLTK_DIR}/include
$ENV{FLTK_DIR} $ENV{FLTK_DIR}

View File

@@ -0,0 +1,117 @@
# - Locate FreeType library
# This module defines
# FREETYPE_LIBRARY, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
# $FREETYPE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$FREETYPE_DIR
# used in building FREETYPE.
# Created by Eric Wing.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS
$ENV{FREETYPE_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
$ENV{FREETYPE_DIR}/include/freetype2
NO_DEFAULT_PATH
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include/freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
/usr/local/include/freetype2
/usr/include/freetype2
/usr/local/X11R6/include/freetype2
/usr/local/X11/include/freetype2
/usr/X11R6/include/freetype2
/usr/X11/include/freetype2
/sw/include/freetype2
/opt/local/include/freetype2
/opt/csw/include/freetype2
/opt/include/freetype2
/usr/freeware/include/freetype2
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS
$ENV{FREETYPE_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_FOUND "NO")
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_FOUND "YES")
ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)

View File

@@ -1,188 +0,0 @@
#.rst:
# FindFreetype
# ------------
#
# Locate FreeType library
#
# This module defines
#
# ::
#
# FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
#
#
# $FREETYPE_DIR is an environment variable that would correspond to the
# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
#=============================================================================
# Copyright 2000-2016 Kitware, Inc.
# Copyright 2000-2011 Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like include_directories()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
# Adapted for OpenSceneGraph until the updates here for finding the debug Windows library freetyped are released with CMake
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
)
find_path(
FREETYPE_INCLUDE_DIR_ft2build
ft2build.h
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
include/freetype2
include
freetype2
)
find_path(
FREETYPE_INCLUDE_DIR_freetype2
NAMES
freetype/config/ftheader.h
config/ftheader.h
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
include/freetype2
include
freetype2
)
if(NOT FREETYPE_LIBRARY)
find_library(FREETYPE_LIBRARY_RELEASE
NAMES
freetype
libfreetype
freetype219
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
lib
)
find_library(FREETYPE_LIBRARY_DEBUG
NAMES
freetyped
libfreetyped
freetype219d
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
lib
)
include(SelectLibraryConfigurations) #OSG Look in CMake Modules dir
select_library_configurations(FREETYPE)
endif()
unset(FREETYPE_FIND_ARGS)
# set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
endif()
if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
file(STRINGS "${FREETYPE_H}" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING)
foreach(VPART MAJOR MINOR PATCH)
foreach(VLINE ${freetype_version_str})
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
if(FREETYPE_VERSION_STRING)
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
else()
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
endif()
unset(FREETYPE_VERSION_PART)
endif()
endforeach()
endforeach()
endif()
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs) #OSG Look in CMake Modules dir
find_package_handle_standard_args(
Freetype
REQUIRED_VARS
FREETYPE_LIBRARY
FREETYPE_INCLUDE_DIRS
VERSION_VAR
FREETYPE_VERSION_STRING
)
mark_as_advanced(
FREETYPE_INCLUDE_DIR_freetype2
FREETYPE_INCLUDE_DIR_ft2build
)

View File

@@ -19,15 +19,6 @@
# This makes the presumption that you are include gdal.h like # This makes the presumption that you are include gdal.h like
# #include "gdal.h" # #include "gdal.h"
# prefer FindGDAL from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindGDAL.cmake)
include(${CMAKE_ROOT}/Modules/FindGDAL.cmake)
if(GDAL_FOUND)
return()
endif()
endif()
FIND_PATH(GDAL_INCLUDE_DIR gdal.h FIND_PATH(GDAL_INCLUDE_DIR gdal.h
PATHS PATHS
$ENV{GDAL_DIR} $ENV{GDAL_DIR}

View File

@@ -1,36 +0,0 @@
# Finds the OpenGL Core Profile (cp) header file.
# Looks for glcorearb.h
#
# This script defines the following:
# GLCORE_FOUND // Set to TRUE if glcorearb.h is found
# GLCORE_INCLUDE_DIR // Parent directory of directory (gl, GL3, or OpenGL) containing the CP header.
# GLCORE_GLCOREARB_HEADER // advanced
#
# GLCORE_ROOT can be set as an environment variable or a CMake variable,
# to the parent directory of the gl, GL3, or OpenGL directory containing the CP header.
#
FIND_PATH( GLCORE_GLCOREARB_HEADER
NAMES GL/glcorearb.h GL3/glcorearb.h OpenGL/glcorearb.h gl/glcorearb.h
HINTS ${GLCORE_ROOT}
PATHS ENV GLCORE_ROOT
)
set( GLCORE_INCLUDE_DIR )
if( GLCORE_GLCOREARB_HEADER )
set( GLCORE_INCLUDE_DIR ${GLCORE_GLCOREARB_HEADER} )
endif()
# handle the QUIETLY and REQUIRED arguments and set
# GLCORE_FOUND to TRUE as appropriate
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLCORE
"Set GLCORE_ROOT as the parent of the directory containing the OpenGL core profile header."
GLCORE_INCLUDE_DIR )
MARK_AS_ADVANCED(
GLCORE_INCLUDE_DIR
GLCORE_GLCOREARB_HEADER
)

View File

@@ -1,142 +0,0 @@
# - Try to find Glib and its components (gio, gobject etc)
# Once done, this will define
#
# GLIB_FOUND - system has Glib
# GLIB_INCLUDE_DIRS - the Glib include directories
# GLIB_LIBRARIES - link these to use Glib
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and Glib components can be looked for. Currently, the following
# components can be used, and they define the following variables if
# found:
#
# gio: GLIB_GIO_LIBRARIES
# gobject: GLIB_GOBJECT_LIBRARIES
# gmodule: GLIB_GMODULE_LIBRARIES
# gthread: GLIB_GTHREAD_LIBRARIES
#
# Note that the respective _INCLUDE_DIR variables are not set, since
# all headers are in the same directory as GLIB_INCLUDE_DIRS.
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (WIN32)
find_library(GLIB_LIBRARIES
NAMES glib-2.0
PATHS C:/gstreamer/1.0/x86_64/lib
)
else ()
find_package(PkgConfig)
pkg_check_modules(PC_GLIB QUIET glib-2.0)
find_library(GLIB_LIBRARIES
NAMES glib-2.0
HINTS ${PC_GLIB_LIBDIR}
${PC_GLIB_LIBRARY_DIRS}
)
endif ()
# Files in glib's main include path may include glibconfig.h, which,
# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
find_path(GLIBCONFIG_INCLUDE_DIR
NAMES glibconfig.h
HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
PATH_SUFFIXES glib-2.0/include
)
if (WIN32)
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
PATHS C:/gstreamer/1.0/x86_64/include
PATH_SUFFIXES glib-2.0
)
else()
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
HINTS ${PC_GLIB_INCLUDEDIR}
${PC_GLIB_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0
)
endif()
if (GLIBCONFIG_INCLUDE_DIR)
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
# Version detection
file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
# Additional Glib components. We only look for libraries, as not all of them
# have corresponding headers and all headers are installed alongside the main
# glib ones.
foreach (_component ${GLIB_FIND_COMPONENTS})
if (${_component} STREQUAL "gio")
find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
elseif (${_component} STREQUAL "gobject")
find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
elseif (${_component} STREQUAL "gmodule")
find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
elseif (${_component} STREQUAL "gthread")
find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
elseif (${_component} STREQUAL "gio-unix")
# gio-unix is compiled as part of the gio library, but the include paths
# are separate from the shared glib ones. Since this is currently only used
# by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
endif ()
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
VERSION_VAR GLIB_VERSION)
mark_as_advanced(
GLIBCONFIG_INCLUDE_DIR
GLIB_GIO_LIBRARIES
GLIB_GIO_UNIX_LIBRARIES
GLIB_GMODULE_LIBRARIES
GLIB_GOBJECT_LIBRARIES
GLIB_GTHREAD_LIBRARIES
GLIB_INCLUDE_DIR
GLIB_INCLUDE_DIRS
GLIB_LIBRARIES
)
else()
endif ()

View File

@@ -1,174 +0,0 @@
# - Try to find GStreamer and its plugins
# Once done, this will define
#
# GSTREAMER_FOUND - system has GStreamer
# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
# GSTREAMER_LIBRARIES - link these to use GStreamer
#
# Additionally, gstreamer-base is always looked for and required, and
# the following related variables are defined:
#
# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and GStreamer plugins can be looked for. Currently, the following
# plugins can be searched, and they define the following variables if
# found:
#
# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Helper macro to find a GStreamer plugin (or GStreamer itself)
# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer-1.0", or "gstreamer-video-1.0").
# _header is the component's header, relative to the gstreamer-1.0 directory (eg. "gst/gst.h").
# _library is the component's library name (eg. "gstreamer-1.0" or "gstvideo-1.0")
#macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
# pkg_check_modules(PC_${_component_prefix} QUIET ${_pkgconfig_name})
#
# find_path(${_component_prefix}_INCLUDE_DIRS
# NAMES ${_header}
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
# PATH_SUFFIXES gstreamer-1.0
# )
#
# find_library(${_component_prefix}_LIBRARIES
# NAMES ${_library}
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
# )
#endmacro()
if (MSVC)
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
find_path(${_component_prefix}_INCLUDE_DIRS
NAMES ${_header}
PATHS C:/gstreamer/1.0/x86_64/include
PATH_SUFFIXES gstreamer-1.0
)
find_library(${_component_prefix}_LIBRARIES
NAMES ${_library}
PATHS C:/gstreamer/1.0/x86_64/lib
)
endmacro()
else ()
find_package(PkgConfig)
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
pkg_check_modules(${_component_prefix} QUIET ${_pkgconfig_name})
# find_path(${_component_prefix}_INCLUDE_DIRS
# NAMES ${_header}
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
# PATH_SUFFIXES gstreamer-1.0
# )
# find_library(${_component_prefix}_LIBRARIES
# NAMES ${_library}
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
# )
endmacro()
endif ()
# ------------------------
# 1. Find GStreamer itself
# ------------------------
# 1.1. Find headers and libraries
FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-1.0 gst/gst.h gstreamer-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-1.0 gst/gst.h gstbase-1.0)
# 1.2. Check GStreamer version
if (GSTREAMER_INCLUDE_DIRS)
if (EXISTS "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h")
file(READ "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h" GSTREAMER_VERSION_CONTENTS)
string(REGEX MATCH "#define +GST_VERSION_MAJOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MINOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MICRO +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GSTREAMER_VERSION "${GSTREAMER_VERSION_MAJOR}.${GSTREAMER_VERSION_MINOR}.${GSTREAMER_VERSION_MICRO}")
endif ()
endif ()
if ("${GStreamer_FIND_VERSION}" VERSION_GREATER "${GSTREAMER_VERSION}")
message(FATAL_ERROR "Required version (" ${GStreamer_FIND_VERSION} ") is higher than found version (" ${GSTREAMER_VERSION} ")")
endif ()
# -------------------------
# 2. Find GStreamer plugins
# -------------------------
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-1.0 gst/app/gstappsink.h gstapp-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-1.0 gst/audio/audio.h gstaudio-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-1.0 gst/fft/gstfft.h gstfft-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-1.0 gst/pbutils/pbutils.h gstpbutils-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gst/video/video.h gstvideo-1.0)
# ------------------------------------------------
# 3. Process the COMPONENTS passed to FIND_PACKAGE
# ------------------------------------------------
set(_GSTREAMER_REQUIRED_VARS GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
foreach (_component ${GStreamer_FIND_COMPONENTS})
set(_gst_component "GSTREAMER_${_component}")
string(TOUPPER ${_gst_component} _UPPER_NAME)
list(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer REQUIRED_VARS ${_GSTREAMER_REQUIRED_VARS}
VERSION_VAR GSTREAMER_VERSION)
mark_as_advanced(
GSTREAMER_APP_INCLUDE_DIRS
GSTREAMER_APP_LIBRARIES
GSTREAMER_AUDIO_INCLUDE_DIRS
GSTREAMER_AUDIO_LIBRARIES
GSTREAMER_BASE_INCLUDE_DIRS
GSTREAMER_BASE_LIBRARIES
GSTREAMER_FFT_INCLUDE_DIRS
GSTREAMER_FFT_LIBRARIES
GSTREAMER_INCLUDE_DIRS
GSTREAMER_LIBRARIES
GSTREAMER_PBUTILS_INCLUDE_DIRS
GSTREAMER_PBUTILS_LIBRARIES
GSTREAMER_VIDEO_INCLUDE_DIRS
GSTREAMER_VIDEO_LIBRARIES
)

View File

@@ -16,42 +16,41 @@ IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(GTA gta) PKG_CHECK_MODULES(GTA gta)
ELSE(PKG_CONFIG_FOUND)
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
$ENV{GTA_DIR}/include
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(GTA_LIBRARIES
NAMES gta libgta
PATHS
$ENV{GTA_DIR}/lib
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(GTA_FOUND "NO")
IF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
ENDIF(PKG_CONFIG_FOUND) ENDIF(PKG_CONFIG_FOUND)
IF(NOT GTA_FOUND)
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
$ENV{GTA_DIR}/include
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(GTA_LIBRARY
NAMES gta libgta
PATHS
$ENV{GTA_DIR}/lib
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(GTA_FOUND "NO")
IF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
ENDIF(NOT GTA_FOUND)

View File

@@ -9,15 +9,6 @@
# #
# Created by Robert Osfield. # Created by Robert Osfield.
# prefer FindJasper from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindJasper.cmake)
include(${CMAKE_ROOT}/Modules/FindJasper.cmake)
if(JASPER_FOUND)
return()
endif()
endif()
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h
$ENV{JASPER_DIR}/include $ENV{JASPER_DIR}/include
$ENV{JASPER_DIR}/src/libjasper/include $ENV{JASPER_DIR}/src/libjasper/include

View File

@@ -1,105 +0,0 @@
#---
# File: FindLIBLAS.cmake
#
# Find the native LIBLAS includes and library
#
# LIBLAS_INCLUDE_DIRS - where to find liblas's includes.
# LIBLAS_LIBRARIES - List of libraries when using liblas.
# LIBLAS_FOUND - True if liblas found.
#---
# Set the include dir:
find_path(LIBLAS_INCLUDE_DIR liblas/liblas.hpp)
# Macro for setting libraries:
macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Debug
${LIBLAS_DIR}/lib64/Debug
${LIBLAS_DIR}/lib
${LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}/lib/debug
$ENV{LIBLAS_DIR}/lib64/debug
NO_DEFAULT_PATH
)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
/usr/freeware/lib64
)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Release
${LIBLAS_DIR}/lib64/Release
${LIBLAS_DIR}/lib
${LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}/lib/Release
$ENV{LIBLAS_DIR}/lib64/Release
$ENV{LIBLAS_DIR}/lib
$ENV{LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}
$ENV{LIBLASDIR}/lib
$ENV{LIBLASDIR}/lib64
$ENV{LIBLASDIR}
$ENV{LIBLAS_ROOT}/lib
$ENV{LIBLAS_ROOT}/lib64
NO_DEFAULT_PATH
)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
/usr/freeware/lib64
)
if( NOT ${MYLIBRARY}_DEBUG )
if( MYLIBRARY )
set( ${MYLIBRARY}_DEBUG ${MYLIBRARY} )
endif(MYLIBRARY)
endif( NOT ${MYLIBRARY}_DEBUG )
endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)
FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)
set(LIBLAS_FOUND "NO")
if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
FIND_PACKAGE(Boost) # used by LIBLAS
if(Boost_FOUND)
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
set(LIBLAS_FOUND "YES")
endif()
endif()

View File

@@ -1,83 +0,0 @@
# Locate Lua library
# This module defines
# LUA51_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUA_LIBRARY
NAMES lua52 lua5.2 lua-5.2 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUA_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE)
find_library(LUA_MATH_LIBRARY m)
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)

View File

@@ -16,7 +16,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
) )
# NVTT # NVTT
FIND_LIBRARY(NVTT_LIBRARY_RELEASE FIND_LIBRARY(NVTT_LIBRARY
NAMES nvtt NAMES nvtt
PATHS PATHS
/usr/local /usr/local
@@ -37,7 +37,7 @@ FIND_LIBRARY(NVTT_LIBRARY_DEBUG
) )
# NVIMAGE # NVIMAGE
FIND_LIBRARY(NVIMAGE_LIBRARY_RELEASE FIND_LIBRARY(NVIMAGE_LIBRARY
NAMES nvimage NAMES nvimage
PATHS PATHS
/usr/local /usr/local
@@ -58,7 +58,7 @@ FIND_LIBRARY(NVIMAGE_LIBRARY_DEBUG
) )
# NVMATH # NVMATH
FIND_LIBRARY(NVMATH_LIBRARY_RELEASE FIND_LIBRARY(NVMATH_LIBRARY
NAMES nvmath NAMES nvmath
PATHS PATHS
/usr/local /usr/local
@@ -79,7 +79,7 @@ FIND_LIBRARY(NVMATH_LIBRARY_DEBUG
) )
# NVCORE # NVCORE
FIND_LIBRARY(NVCORE_LIBRARY_RELEASE FIND_LIBRARY(NVCORE_LIBRARY
NAMES nvcore NAMES nvcore
PATHS PATHS
/usr/local /usr/local
@@ -98,114 +98,10 @@ FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
) )
# NVTHREAD
FIND_LIBRARY(NVTHREAD_LIBRARY_RELEASE
NAMES nvthread
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVTHREAD_LIBRARY_DEBUG
NAMES nvthread_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# SQUISH
FIND_LIBRARY(NVSQUISH_LIBRARY_RELEASE
NAMES squish
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVSQUISH_LIBRARY_DEBUG
NAMES squish_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC6H
FIND_LIBRARY(NVBC6H_LIBRARY_RELEASE
NAMES bc6h
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC6H_LIBRARY_DEBUG
NAMES bc6h_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC7
FIND_LIBRARY(NVBC7_LIBRARY_RELEASE
NAMES bc7
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC7_LIBRARY_DEBUG
NAMES bc7_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
IF (WIN32)
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE" "NVTHREAD" "NVBC7" "NVBC6H" "NVSQUISH")
ELSE()
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE")
ENDIF()
FOREACH(LIB ${LIBS_TO_SETUP})
IF(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ELSE(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARY_DEBUG ${${LIB}_LIBRARY_RELEASE})
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ENDIF(${LIB}_LIBRARY_DEBUG)
ENDFOREACH(LIB ${LIBS_TO_SETUP})
SET(NVTT_LIBRARIES
${NVTT_LIBRARIES}
${NVCORE_LIBRARIES}
${NVMATH_LIBRARIES}
${NVIMAGE_LIBRARIES}
${NVTHREAD_LIBRARIES}
${NVBC7_LIBRARIES}
${NVBC6H_LIBRARIES}
${NVSQUISH_LIBRARIES}
)
SET(NVTT_FOUND "NO") SET(NVTT_FOUND "NO")
IF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR) IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
SET(NVTT_FOUND "YES" ) SET(NVTT_FOUND "YES")
ENDIF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR) ENDIF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)

View File

@@ -1,13 +1,13 @@
# Locate gdal # Locate gdal
# This module defines # This module defines
# OSG_LIBRARY # OSG_LIBRARY
# OSG_FOUND, if false, do not try to link to gdal # OSG_FOUND, if false, do not try to link to gdal
# OSG_INCLUDE_DIR, where to find the headers # OSG_INCLUDE_DIR, where to find the headers
# #
# $OSG_DIR is an environment variable that would # $OSG_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OSG_DIR # correspond to the ./configure --prefix=$OSG_DIR
# #
# Created by Robert Osfield. # Created by Robert Osfield.
FIND_PATH(OSG_INCLUDE_DIR osg/Node FIND_PATH(OSG_INCLUDE_DIR osg/Node
${OSG_DIR}/include ${OSG_DIR}/include
@@ -59,7 +59,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64 /usr/freeware/lib64
) )
FIND_LIBRARY(${MYLIBRARY} FIND_LIBRARY(${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS PATHS
@@ -107,7 +107,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
ENDIF(NOT MYLIBRARY) ENDIF(NOT MYLIBRARY)
ENDIF( NOT ${MYLIBRARY}_DEBUG ) ENDIF( NOT ${MYLIBRARY}_DEBUG )
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME) ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
FIND_OSG_LIBRARY(OSG_LIBRARY osg) FIND_OSG_LIBRARY(OSG_LIBRARY osg)
@@ -116,6 +116,7 @@ FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB) FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText) FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget) FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
FIND_OSG_LIBRARY(OSGQT_LIBRARY osgQt)
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain) FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX) FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer) FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
@@ -125,7 +126,7 @@ FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle) FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow) FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation) FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim) FIND_OSG_LIBRARY(OSGSIM osgSim)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads) FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)

View File

@@ -1,173 +0,0 @@
# LocateOPENCASCADE
# This module defines
# OPENCASCADE_LIBRARY
# OPENCASCADE_FOUND, if false, do not try to link to OPENCASCADE
# OPENCASCADE_INCLUDE_DIR, where to find the headers
#
# $OPENCASCADE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
# used in building OPENCASCADE.
FIND_PATH(OPENCASCADE_INCLUDE_DIR BRepMesh.hxx
PATHS
${OPENCASCADE_DIR}
$ENV{OPENCASCADE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
/usr/freeware
PATH_SUFFIXES
opencascade
inc
include
inc/cascade
include/cascade
)
MACRO(FIND_OPENCASCADE_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY("${MYLIBRARY}"
NAMES "${MYLIBRARYNAME}"
PATHS
$ENV{OPENCASCADE_DIR}/lib}
$ENV{OPENCASCADE_LIB}
${OPENCASCADE_DIR}/lib
$ENV{OPENCASCADE_DIR}/lib
${OPENCASCADE_DIR}/lib/
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO()
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinL TKBinL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBin TKBin)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinTObj TKBinTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinXCAF TKBinXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBool TKBool)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBO TKBO)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBRep TKBRep)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCAF TKCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCDF TKCDF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKernel TKernel)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFeat TKFeat)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFillet TKFillet)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG2d TKG2d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG3d TKG3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomAlgo TKGeomAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomBase TKGeomBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKHLR TKHLR)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKIGES TKIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKLCAF TKLCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMath TKMath)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMesh TKMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMeshVS TKMeshVS)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOffset TKOffset)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOpenGl TKOpenGl)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKPrim TKPrim)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKService TKService)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKShHealing TKShHealing)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP209 TKSTEP209)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPAttr TKSTEPAttr)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPBase TKSTEPBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP TKSTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTL TKSTL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTObj TKTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTopAlgo TKTopAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKV3d TKV3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKVRML TKVRML)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDEIGES TKXDEIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDESTEP TKXDESTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXMesh TKXMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlL TKXmlL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXml TKXml)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlTObj TKXmlTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
set (OPENCASCADE_LIBRARY_TYPE_DESCR
"Specifies the type of library to be used. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries
are archives of object files for use when linking other targets")
# set type of OCCT libraries
if (NOT OPENCASCADE_LIBRARY_TYPE)
set (OPENCASCADE_LIBRARY_TYPE "Static" CACHE STRING "${OPENCASCADE_LIBRARY_TYPE_DESCR}" FORCE)
SET_PROPERTY(CACHE OPENCASCADE_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
endif()
if ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXSBase}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKShHealing}
)
else ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKBO}
${OPENCASCADE_TKBool}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKCAF}
${OPENCASCADE_TKCDF}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKG2d}
${OPENCASCADE_TKG3d}
${OPENCASCADE_TKGeomAlgo}
${OPENCASCADE_TKGeomBase}
${OPENCASCADE_TKHLR}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKPrim}
${OPENCASCADE_TKService}
${OPENCASCADE_TKShHealing}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKV3d}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKXSBase}
)
endif ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_FOUND "NO")
IF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
IF(OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_INCLUDE_DIR)

View File

@@ -9,7 +9,6 @@
# #
# Created by Robert Osfield. # Created by Robert Osfield.
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
$ENV{OPENEXR_DIR}/include $ENV{OPENEXR_DIR}/include
$ENV{OPENEXR_DIR} $ENV{OPENEXR_DIR}
@@ -24,38 +23,78 @@ FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
/usr/freeware/include /usr/freeware/include
) )
# Macro to find exr libraries (deduplicating search paths) FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
# example: OPENEXR_FIND_VAR(OPENEXR_IlmImf_LIBRARY IlmImf) NAMES IlmImf
MACRO(OPENEXR_FIND_VAR varname libname) PATHS
FIND_LIBRARY( ${varname} $ENV{OPENEXR_DIR}/lib
NAMES ${libname} ${libname}-2_1 ${libname}-2_2 $ENV{OPENEXR_DIR}
PATHS ~/Library/Frameworks
$ENV{OPENEXR_DIR}/lib /Library/Frameworks
$ENV{OPENEXR_DIR} /usr/local/lib
~/Library/Frameworks /usr/lib
/Library/Frameworks /sw/lib
/usr/local/lib /opt/local/lib
/usr/lib /opt/csw/lib
/sw/lib /opt/lib
/opt/local/lib /usr/freeware/lib64
/opt/csw/lib )
/opt/lib
/usr/freeware/lib64
)
ENDMACRO(OPENEXR_FIND_VAR)
# Macro to find exr libraries (and debug versions) FIND_LIBRARY(OPENEXR_IlmThread_LIBRARY
# example: OPENEXR_FIND(IlmImf) NAMES IlmThread
MACRO(OPENEXR_FIND libname) PATHS
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY ${libname}) $ENV{OPENEXR_DIR}/lib
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY_DEBUG ${libname}d) $ENV{OPENEXR_DIR}
ENDMACRO(OPENEXR_FIND) ~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
OPENEXR_FIND(IlmImf)
FIND_LIBRARY(OPENEXR_Iex_LIBRARY
NAMES Iex
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_LIBRARY(OPENEXR_Half_LIBRARY
NAMES Half
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(OPENEXR_FOUND "NO") SET(OPENEXR_FOUND "NO")
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY) IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} ) SET(OPENEXR_LIBRARIES
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY ) ${OPENEXR_IlmIlf_LIBRARY}
${OPENEXR_IlmThread_LIBRARY}
${OPENEXR_Half_LIBRARY}
${OPENEXR_Iex_LIBRARY}
)
SET(OPENEXR_FOUND "YES") SET(OPENEXR_FOUND "YES")
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY) ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)

View File

@@ -17,16 +17,6 @@
# #
# Created by Eric Wing. # Created by Eric Wing.
# prefer FindOpenThreads from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
include(${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
if(OPENTHREADS_FOUND)
return()
endif()
endif()
# Header files are presumed to be included like # Header files are presumed to be included like
# #include <OpenThreads/Thread> # #include <OpenThreads/Thread>

View File

@@ -0,0 +1,270 @@
# - find DCMTK libraries
#
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
#
# DCMTK_DIR can be used to make it simpler to find the various include
# directories and compiled libraries if you've just compiled it in the
# source tree. Just set it to the root of the tree where you extracted
# the source.
#
# Written for VXL by Amitha Perera.
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/
/usr/include/
/usr/local/dicom/include/
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/dcmtk/config
/usr/include/dcmtk/config
/usr/local/dicom/include/dcmtk/config
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/dicom/include/dcmtk/ofstd
/usr/local/include/dcmtk/ofstd
/usr/include/dcmtk/ofstd
/usr/local/dicom/include/dcmtk/ofstd
)
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/ofstd/libsrc
${DCMTK_DIR}/ofstd/libsrc/Release
${DCMTK_DIR}/ofstd/libsrc/Debug
${DCMTK_DIR}/ofstd/Release
${DCMTK_DIR}/ofstd/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
${DCMTK_DIR}/dcmdata/include
${DCMTK_DIR}/include/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
/usr/local/include/dcmtk/dcmdata
/usr/include/dcmtk/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
)
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
PATHS
${DCMTK_DIR}/dcmdata/libsrc
${DCMTK_DIR}/dcmdata/libsrc/Release
${DCMTK_DIR}/dcmdata/libsrc/Debug
${DCMTK_DIR}/dcmdata/Release
${DCMTK_DIR}/dcmdata/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
${DCMTK_DIR}/dcmimgle/include
${DCMTK_DIR}/include/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
/usr/local/include/dcmtk/dcmimgle
/usr/include/dcmtk/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
)
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
PATHS
${DCMTK_DIR}/dcmimgle/libsrc
${DCMTK_DIR}/dcmimgle/libsrc/Release
${DCMTK_DIR}/dcmimgle/libsrc/Debug
${DCMTK_DIR}/dcmimgle/Release
${DCMTK_DIR}/dcmimgle/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimage_INCLUDE_DIR diregist.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimage
${DCMTK_DIR}/dcmimage/include
${DCMTK_DIR}/include/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
/usr/local/include/dcmtk/dcmimage
/usr/include/dcmtk/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
)
FIND_LIBRARY( DCMTK_dcmimage_LIBRARY dcmimage
PATHS
${DCMTK_DIR}/dcmimage/libsrc
${DCMTK_DIR}/dcmimage/libsrc/Release
${DCMTK_DIR}/dcmimage/libsrc/Debug
${DCMTK_DIR}/dcmimage/Release
${DCMTK_DIR}/dcmimage/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
PATHS
${DCMTK_DIR}/imagectn/libsrc/Release
${DCMTK_DIR}/imagectn/libsrc/
${DCMTK_DIR}/imagectn/libsrc/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_oflog_LIBRARY oflog
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
AND DCMTK_dcmimgle_INCLUDE_DIR
AND DCMTK_dcmimgle_LIBRARY
AND DCMTK_dcmimage_INCLUDE_DIR
AND DCMTK_dcmimage_LIBRARY )
SET( DCMTK_FOUND "YES" )
SET( DCMTK_INCLUDE_DIRS
${DCMTK_config_INCLUDE_DIR}
${DCMTK_ofstd_INCLUDE_DIR}
${DCMTK_dcmdata_INCLUDE_DIR}
${DCMTK_dcmimgle_INCLUDE_DIR}
${DCMTK_dcmimage_INCLUDE_DIR}
)
SET( DCMTK_LIBRARIES
${DCMTK_dcmimgle_LIBRARY}
${DCMTK_dcmimage_LIBRARY}
${DCMTK_dcmdata_LIBRARY}
${DCMTK_ofstd_LIBRARY}
${DCMTK_config_LIBRARY}
)
IF(DCMTK_imagedb_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_imagedb_LIBRARY}
)
ENDIF()
IF(DCMTK_dcmnet_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_dcmnet_LIBRARY}
)
ENDIF()
IF(DCMTK_oflog_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_oflog_LIBRARY}
)
ENDIF()
IF(DCMTK_ofstd_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_ofstd_LIBRARY}
)
ENDIF()
IF( WIN32 )
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF()
ENDIF()
IF( NOT DCMTK_FOUND )
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
MARK_AS_ADVANCED( DCMTK_DIR )
ENDIF()

View File

@@ -1,14 +1,13 @@
# Locate QuickTime # Locate QuickTime
# This module defines # This module defines
# QUICKTIME_LIBRARY # QUICKTIME_LIBRARY
# QUICKTIME_FOUND, if false, do not try to link to gdal # QUICKTIME_FOUND, if false, do not try to link to gdal
# QUICKTIME_INCLUDE_DIR, where to find the headers # QUICKTIME_INCLUDE_DIR, where to find the headers
# #
# $QUICKTIME_DIR is an environment variable that would # $QUICKTIME_DIR is an environment variable that would
# correspond to the ./configure --prefix=$QUICKTIME_DIR # correspond to the ./configure --prefix=$QUICKTIME_DIR
# #
# Created by Eric Wing. # Created by Eric Wing.
# QuickTime on OS X looks different than QuickTime for Windows, # QuickTime on OS X looks different than QuickTime for Windows,
# so I am going to case the two. # so I am going to case the two.
@@ -55,20 +54,19 @@ ELSE()
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it. #Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch #First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8) IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE("Disabling QuickTime on 64-bit architectures")
SET(QUICKTIME_FOUND "NO")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.6)
# Quicktime officially deprecated starting 10.7
MESSAGE("Disabling QuickTime because it's not supported by the selected SDK ${OSG_OSX_VERSION}")
SET(QUICKTIME_FOUND "NO")
ELSE()
#Otherwise check to see if 64-bit is explicitly called for.
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
IF(NOT has64Compile EQUAL -1)
MESSAGE("Disabling QuickTime on 64-bit architectures")
SET(QUICKTIME_FOUND "NO") SET(QUICKTIME_FOUND "NO")
ENDIF() ELSE()
#Otherwise check to see if 64-bit is explicitly called for.
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
IF(NOT has64Compile EQUAL -1)
SET(QUICKTIME_FOUND "NO")
ENDIF()
ENDIF()
# Disable quicktime for >= 10.7, as it's officially deprecated
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9")
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
SET(QUICKTIME_FOUND "NO")
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@@ -5,9 +5,7 @@ IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
#Version 2.35 introduces the rsvg_cleanup function which is used PKG_CHECK_MODULES(RSVG librsvg-2.0)
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
PKG_CHECK_MODULES(CAIRO cairo) PKG_CHECK_MODULES(CAIRO cairo)
IF (RSVG_FOUND AND NOT CAIRO_FOUND) IF (RSVG_FOUND AND NOT CAIRO_FOUND)

View File

@@ -1,178 +0,0 @@
# - Locate SDL library
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL
# SDL2_INCLUDE_DIR, where to find SDL.h
# SDL2_VERSION_STRING, human-readable string containing the version of SDL
#
# This module responds to the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL library
# (SDL.dll, libsdl.so, SDL.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
ENV SDL2DIR
PATH_SUFFIXES include/SDL2
)
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
find_library(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
ENV SDL2DIR
PATH_SUFFIXES lib
)
if(NOT SDL2_BUILDING_LIBRARY)
if(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
find_library(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
ENV SDL2DIR
PATH_SUFFIXES lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
endif()
endif()
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
if(NOT APPLE)
find_package(Threads)
endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
if(MINGW)
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
endif()
if(SDL2_LIBRARY_TEMP)
# For SDLmain
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
if(_SDL2_MAIN_INDEX EQUAL -1)
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP})
endif()
unset(_SDL2_MAIN_INDEX)
endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
if(APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
endif()
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
if(NOT APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
endif()
# For MinGW library
if(MINGW)
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
endif()
# Set the final string here so the GUI reflects the final state.
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL2_version.h")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH})
unset(SDL2_VERSION_MAJOR_LINE)
unset(SDL2_VERSION_MINOR_LINE)
unset(SDL2_VERSION_PATCH_LINE)
unset(SDL2_VERSION_MAJOR)
unset(SDL2_VERSION_MINOR)
unset(SDL2_VERSION_PATCH)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
VERSION_VAR SDL2_VERSION_STRING)

View File

@@ -1,45 +0,0 @@
# Locate V8
# This module defines
# V8_LIBRARY
# V8_FOUND, if false, do not try to link to gdal
# V8_INCLUDE_DIR, where to find the headers
#
# $V8_DIR is an environment variable that would
# correspond to the ./configure --prefix=$V8_DIR
#
# Created by Robert Osfield (based on FindFLTK.cmake)
FIND_PATH(V8_INCLUDE_DIR v8.h
$ENV{V8_DIR}/include
$ENV{V8_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(V8_LIBRARY
NAMES v8 libv8
PATHS
$ENV{V8_DIR}/lib
$ENV{V8_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(V8_FOUND "NO")
IF(V8_LIBRARY AND V8_INCLUDE_DIR)
SET(V8_FOUND "YES")
ENDIF()

View File

@@ -0,0 +1,48 @@
# Locate zlib
# This module defines
# ZLIB_LIBRARY
# ZLIB_FOUND, if false, do not try to link to zlib
# ZLIB_INCLUDE_DIR, where to find the headers
#
# $ZLIB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ZLIB_DIR
# used in building zlib.
#
# Created by Ulrich Hertlein.
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
$ENV{ZLIB_DIR}/include
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES z libz zlib
PATHS
$ENV{ZLIB_DIR}/lib
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(ZLIB_FOUND "NO")
IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
SET(ZLIB_FOUND "YES")
ENDIF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)

0
CMakeModules/FindZeroConf.cmake Normal file → Executable file
View File

View File

@@ -1,63 +0,0 @@
# Locate ILMBASE
# This module defines
# ILMBASE_LIBRARY
# ILMBASE_FOUND, if false, do not try to link to ILMBASE
# ILMBASE_INCLUDE_DIR, where to find the headers
#
# $ILMBASE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ILMBASE_DIR
#
# Created by Robert Osfield.
FIND_PATH(ILMBASE_INCLUDE_DIR OpenEXR/ImathVec.h
$ENV{ILMBASE_DIR}/include
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
# Macro to find ilmbase libraries
# example: ILMBASE_FIND_VAR(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND_VAR varname libname)
FIND_LIBRARY( ${varname}
NAMES ${libname} ${libname}-2_1 ${libname}-2_2
PATHS
$ENV{ILMBASE_DIR}/lib
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO(ILMBASE_FIND_VAR)
# Macro to find exr libraries (and debug versions)
# example: ILMBASE_FIND(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND libname)
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY ${libname})
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY_DEBUG ${libname}d)
ENDMACRO(ILMBASE_FIND)
ILMBASE_FIND(IlmThread)
ILMBASE_FIND(Iex)
ILMBASE_FIND(Half)
SET(ILMBASE_FOUND "NO")
IF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)
SET(ILMBASE_LIBRARIES ${ILMBASE_IlmThread_LIBRARY} ${ILMBASE_Half_LIBRARY} ${ILMBASE_Iex_LIBRARY} )
SET(ILMBASE_LIBRARIES_VARS ILMBASE_IlmThread_LIBRARY ILMBASE_Half_LIBRARY ILMBASE_Iex_LIBRARY )
SET(ILMBASE_FOUND "YES")
ENDIF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)

View File

@@ -25,6 +25,14 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL() HANDLE_MSVC_DLL()
ENDIF() ENDIF()
IF(ANDROID)
INSTALL (
FILES ${TARGET_H}
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
COMPONENT libopenscenegraph-dev
)
ELSE(ANDROID)
INSTALL( INSTALL(
TARGETS ${LIB_NAME} TARGETS ${LIB_NAME}
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
@@ -32,12 +40,6 @@ INSTALL(
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
) )
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
IF(NOT OSG_COMPILE_FRAMEWORKS) IF(NOT OSG_COMPILE_FRAMEWORKS)
INSTALL ( INSTALL (
FILES ${TARGET_H} FILES ${TARGET_H}
@@ -57,3 +59,4 @@ ELSE()
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}") # MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
ENDIF() ENDIF()
ENDIF(ANDROID)

View File

@@ -67,7 +67,7 @@ MACRO(ANDROID_3RD_PARTY)
#JPEG #JPEG
################################################ ################################################
FIND_PATH(JPEG_INCLUDE_DIR Android.mk FIND_PATH(JPEG_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libjpeg NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libjpeg
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libjpeg") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libjpeg")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${JPEG_INCLUDE_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${JPEG_INCLUDE_DIR}/Android.mk \n")
@@ -82,7 +82,7 @@ MACRO(ANDROID_3RD_PARTY)
#PNG #PNG
################################################ ################################################
FIND_PATH(PNG_INCLUDE_DIR Android.mk FIND_PATH(PNG_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libpng NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libpng
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libpng") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libpng")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${PNG_INCLUDE_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${PNG_INCLUDE_DIR}/Android.mk \n")
@@ -97,7 +97,7 @@ MACRO(ANDROID_3RD_PARTY)
#GIF #GIF
################################################ ################################################
FIND_PATH(GIFLIB_INCLUDE_DIR Android.mk FIND_PATH(GIFLIB_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/giflib NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/giflib
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libgif") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libgif")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${GIFLIB_INCLUDE_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${GIFLIB_INCLUDE_DIR}/Android.mk \n")
@@ -112,7 +112,7 @@ MACRO(ANDROID_3RD_PARTY)
#TIF #TIF
################################################ ################################################
FIND_PATH(TIFF_INCLUDE_DIR Android.mk FIND_PATH(TIFF_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libtiff NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libtiff
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libtiff") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libtiff")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${TIFF_INCLUDE_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${TIFF_INCLUDE_DIR}/Android.mk \n")
@@ -142,7 +142,7 @@ MACRO(ANDROID_3RD_PARTY)
#CURL #CURL
################################################ ################################################
FIND_PATH(CURL_DIR Android.mk FIND_PATH(CURL_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/curl NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/curl
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libcurl") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libcurl")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CURL_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CURL_DIR}/Android.mk \n")
@@ -159,11 +159,11 @@ MACRO(ANDROID_3RD_PARTY)
#FREETYPE #FREETYPE
################################################ ################################################
FIND_PATH(FREETYPE_DIR Android.mk FIND_PATH(FREETYPE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/freetype NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/freetype
) )
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2") #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n") #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n")
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config) set(FREETYPE_INCLUDE_DIRS "${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config")
if(FREETYPE_DIR) if(FREETYPE_DIR)
message(STATUS "FREETYPE found ${FREETYPE_DIR}" ) message(STATUS "FREETYPE found ${FREETYPE_DIR}" )
set(FREETYPE_FOUND "Yes") set(FREETYPE_FOUND "Yes")
@@ -175,7 +175,7 @@ MACRO(ANDROID_3RD_PARTY)
#GDAL #GDAL
################################################ ################################################
FIND_PATH(GDAL_DIR gdal.h FIND_PATH(GDAL_DIR gdal.h
${CMAKE_SOURCE_DIR}/3rdparty/gdal/include NO_CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/3rdparty/gdal/include
) )
set(GDAL_INCLUDE_DIR "${GDAL_DIR}") set(GDAL_INCLUDE_DIR "${GDAL_DIR}")
if(GDAL_DIR) if(GDAL_DIR)

View File

@@ -57,7 +57,7 @@ ENDIF()
SET(CPACK_SOURCE_GENERATOR "TGZ") SET(CPACK_SOURCE_GENERATOR "TGZ")
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...) # for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
IF(MSVC_IDE) IF(MSVC_IDE)
SET(OSG_CPACK_CONFIGURATION "$(OutDir)") SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
SET(PACKAGE_TARGET_PREFIX "Package ") SET(PACKAGE_TARGET_PREFIX "Package ")
@@ -84,87 +84,9 @@ ENDIF()
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL") SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME}) ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
# cpack configuration for debian packages
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(OPENSCENEGRAPH_PACKAGE_MAINTAINER
""
CACHE STRING
"Name and email address of the package maintainer, e.g., 'Jon Doe <jon.doe@superawesomemail.com>'"
)
SET(CPACK_LIBOPENSCENEGRAPH_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
MACRO(GENERATE_PACKAGING_TARGET package_name) MACRO(GENERATE_PACKAGING_TARGET package_name)
SET(CPACK_PACKAGE_NAME ${package_name}) SET(CPACK_PACKAGE_NAME ${package_name})
# set debian dependencies AND conflicts
IF(${CPACK_GENERATOR} STREQUAL "DEB")
STRING(TOUPPER CPACK_${package_name}_DEPENDENCIES DEPENDENCIES_VAR)
STRING(TOUPPER CPACK_${package_name}_CONFLICTS CONFLICTS_VAR)
SET(OSG_PACKAGE_DEPENDS "${${DEPENDENCIES_VAR}}")
SET(OSG_PACKAGE_CONFLICTS "${${CONFLICTS_VAR}}")
ENDIF()
# the doc packages don't need a system-arch specification # the doc packages don't need a system-arch specification
IF(${package} MATCHES -doc) IF(${package} MATCHES -doc)
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION}) SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
@@ -192,7 +114,7 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
ELSE() ELSE()
SET(ARCHIVE_EXT "tar.gz") SET(ARCHIVE_EXT "tar.gz")
ENDIF() ENDIF()
# Create a target that creates the current package # Create a target that creates the current package
# and rename the package to give it proper filename # and rename the package to give it proper filename
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME}) ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
@@ -202,8 +124,8 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
COMMENT "Run CPack packaging for ${package_name}..." COMMENT "Run CPack packaging for ${package_name}..."
) )
# Add the exact same custom command to the all package generating target. # Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallel building of packages so am going brute here # I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME} ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
) )

View File

@@ -53,7 +53,7 @@ SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake") SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/") SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.md") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit")
SET(CPACK_PACKAGE_FILE_NAME "${OSG_PACKAGE_FILE_NAME}") SET(CPACK_PACKAGE_FILE_NAME "${OSG_PACKAGE_FILE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
@@ -66,16 +66,6 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}") SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}") SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.md") SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt") SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
SET(CPACK_STRIP_FILES "ON") SET(CPACK_STRIP_FILES "ON")
# DEBIAN OPTIONS
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${OPENSCENEGRAPH_PACKAGE_MAINTAINER}")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.openscenegraph.org")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Development")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${OSG_PACKAGE_DEPENDS}")
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "${OSG_PACKAGE_CONFLICTS}")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${OpenSceneGraph_SOURCE_DIR}/debian_scripts/postinst;")
ENDIF()

View File

@@ -1,22 +0,0 @@
# - If Windows is used, this script sets the variable WIN32_WINNT to the corresponding windows version
if (WIN32)
message(STATUS "Checking windows version...")
macro(get_WIN32_WINNT version)
if (CMAKE_SYSTEM_VERSION)
set(ver ${CMAKE_SYSTEM_VERSION})
string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
# Check for Windows 10, b/c we'll need to convert to hex 'A'.
if ("${verMajor}" MATCHES "10")
set(verMajor "A")
string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
endif ("${verMajor}" MATCHES "10")
# Remove all remaining '.' characters.
string(REPLACE "." "" ver ${ver})
# Prepend each digit with a zero.
string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
set(${version} "0x${ver}")
endif(CMAKE_SYSTEM_VERSION)
endmacro(get_WIN32_WINNT)
endif(WIN32)

View File

@@ -4,8 +4,8 @@
# full path of the library name. in order to differentiate release and debug, this macro get the # full path of the library name. in order to differentiate release and debug, this macro get the
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters # NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
# is intended as a list of variable names each one containing the path of the libraries to link to # is intended as a list of variable names each one containing the path of the libraries to link to
# The existence of a variable name with _DEBUG appended is tested and, in case it' s value is used # The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used
# for linking to when in debug mode # for linking to when in debug mode
# the content of this library for linking when in debugging # the content of this library for linking when in debugging
####################################################################################################### #######################################################################################################
@@ -27,10 +27,15 @@ MACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
ENDIF() ENDIF()
ENDMACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER) ENDMACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
# CMAKE24: if CMake version is <2.6.0.
SET(CMAKE24 OFF)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
SET(CMAKE24 ON)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
# CMAKE_VERSION_TEST: Define whether "IF(${CMAKE_VERSION} VERSION_LESS "x.y.z")" can be used or not. # CMAKE_VERSION_TEST: Define whether "IF(${CMAKE_VERSION} VERSION_LESS "x.y.z")" can be used or not.
BUILDER_VERSION_GREATER(2 8 0) BUILDER_VERSION_GREATER(2 6 3)
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.8.0 SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.6.4
SET(VALID_BUILDER_VERSION OFF) SET(VALID_BUILDER_VERSION OFF)
@@ -38,13 +43,9 @@ SET(VALID_BUILDER_VERSION OFF)
MACRO(LINK_WITH_VARIABLES TRGTNAME) MACRO(LINK_WITH_VARIABLES TRGTNAME)
FOREACH(varname ${ARGN}) FOREACH(varname ${ARGN})
IF(${varname}_DEBUG) IF(${varname}_DEBUG)
IF(${varname}_RELEASE) TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}")
ELSE(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ENDIF(${varname}_RELEASE)
ELSE(${varname}_DEBUG) ELSE(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} ${${varname}} ) TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" )
ENDIF(${varname}_DEBUG) ENDIF(${varname}_DEBUG)
ENDFOREACH(varname) ENDFOREACH(varname)
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME) ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
@@ -82,16 +83,16 @@ ENDMACRO(LINK_EXTERNAL TRGTNAME)
MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME) MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES}) #SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY}) SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE) IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY}) SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF() ENDIF()
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES}) LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
LINK_WITH_VARIABLES(${CORELIB_NAME} OPENTHREADS_LIBRARY) LINK_WITH_VARIABLES(${CORELIB_NAME} OPENTHREADS_LIBRARY)
IF(OPENSCENEGRAPH_SONAMES) IF(OPENSCENEGRAPH_SONAMES)
SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES VERSION ${OPENSCENEGRAPH_VERSION} SOVERSION ${OPENSCENEGRAPH_SOVERSION}) SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES VERSION ${OPENSCENEGRAPH_VERSION} SOVERSION ${OPENSCENEGRAPH_SOVERSION})
ENDIF(OPENSCENEGRAPH_SONAMES) ENDIF(OPENSCENEGRAPH_SONAMES)
ENDMACRO(LINK_CORELIB_DEFAULT CORELIB_NAME) ENDMACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
@@ -111,20 +112,20 @@ MACRO(SETUP_LINK_LIBRARIES)
###################################################################### ######################################################################
# #
# This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins # This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES # kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
# they are combined in a single list checked for unicity # they are combined in a single list checked for unicity
# the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug # the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug
# #
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized # a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
################################################################################## ##################################################################################
SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES}) SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES})
FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES}) FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES})
SET(TO_INSERT TRUE) SET(TO_INSERT TRUE)
FOREACH (value ${TARGET_COMMON_LIBRARIES}) FOREACH (value ${TARGET_COMMON_LIBRARIES})
IF ("${value}" STREQUAL "${LINKLIB}") IF (${value} STREQUAL ${LINKLIB})
SET(TO_INSERT FALSE) SET(TO_INSERT FALSE)
ENDIF ("${value}" STREQUAL "${LINKLIB}") ENDIF (${value} STREQUAL ${LINKLIB})
ENDFOREACH (value ${TARGET_COMMON_LIBRARIES}) ENDFOREACH (value ${TARGET_COMMON_LIBRARIES})
IF(TO_INSERT) IF(TO_INSERT)
LIST(APPEND TARGET_LIBRARIES ${LINKLIB}) LIST(APPEND TARGET_LIBRARIES ${LINKLIB})
@@ -133,8 +134,8 @@ MACRO(SETUP_LINK_LIBRARIES)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES}) #SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY}) SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE) IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY}) SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF() ENDIF()
# FOREACH(LINKLIB ${TARGET_LIBRARIES}) # FOREACH(LINKLIB ${TARGET_LIBRARIES})
@@ -150,7 +151,7 @@ MACRO(SETUP_LINK_LIBRARIES)
ENDIF(TARGET_LIBRARIES_VARS) ENDIF(TARGET_LIBRARIES_VARS)
IF(MSVC AND OSG_MSVC_VERSIONED_DLL) IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
#when using full path name to specify linkage, it seems that already linked libs must be specified #when using full path name to specify linkage, it seems that already linked libs must be specified
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES}) LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL) ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDMACRO(SETUP_LINK_LIBRARIES) ENDMACRO(SETUP_LINK_LIBRARIES)
@@ -211,10 +212,9 @@ ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
########################################################################################################## ##########################################################################################################
MACRO(SETUP_LIBRARY LIB_NAME) MACRO(SETUP_LIBRARY LIB_NAME)
IF(GLCORE_FOUND) IF(ANDROID)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} ) SETUP_ANDROID_LIBRARY(${LIB_NAME})
ENDIF() ELSE()
SET(TARGET_NAME ${LIB_NAME} ) SET(TARGET_NAME ${LIB_NAME} )
SET(TARGET_TARGETNAME ${LIB_NAME} ) SET(TARGET_TARGETNAME ${LIB_NAME} )
ADD_LIBRARY(${LIB_NAME} ADD_LIBRARY(${LIB_NAME}
@@ -224,16 +224,10 @@ MACRO(SETUP_LIBRARY LIB_NAME)
${TARGET_SRC} ${TARGET_SRC}
) )
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core") SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
IF(APPLE)
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
ENDIF()
IF(TARGET_LABEL) IF(TARGET_LABEL)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
ENDIF(TARGET_LABEL) ENDIF(TARGET_LABEL)
IF(TARGET_LIBRARIES) IF(TARGET_LIBRARIES)
LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES}) LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES})
ENDIF() ENDIF()
@@ -244,14 +238,15 @@ MACRO(SETUP_LIBRARY LIB_NAME)
LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS}) LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS})
ENDIF(TARGET_LIBRARIES_VARS) ENDIF(TARGET_LIBRARIES_VARS)
LINK_CORELIB_DEFAULT(${LIB_NAME}) LINK_CORELIB_DEFAULT(${LIB_NAME})
ENDIF()
INCLUDE(ModuleInstall OPTIONAL) INCLUDE(ModuleInstall OPTIONAL)
ENDMACRO(SETUP_LIBRARY LIB_NAME) ENDMACRO(SETUP_LIBRARY LIB_NAME)
MACRO(SETUP_PLUGIN PLUGIN_NAME) MACRO(SETUP_PLUGIN PLUGIN_NAME)
IF(GLCORE_FOUND) IF(ANDROID)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} ) SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
ENDIF() ELSE()
SET(TARGET_NAME ${PLUGIN_NAME} ) SET(TARGET_NAME ${PLUGIN_NAME} )
@@ -269,54 +264,42 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
## plugins gets put in libopenscenegraph by default ## plugins gets put in libopenscenegraph by default
IF(${ARGC} GREATER 1) IF(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1}) SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
# add cpack config variables for plugin with own package
IF(BUILD_OSG_PACKAGES)
IF("${CPACK_GENERATOR}" STREQUAL "DEB")
STRING(TOUPPER ${PACKAGE_COMPONENT} UPPER_PACKAGE_COMPONENT)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the ${PACKAGE_COMPONENT} package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_CONFLICTS
""
CACHE STRING
"Conflicting packages for the ${PACKAGE_COMPONENT} package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
ENDIF()
ELSE(${ARGC} GREATER 1) ELSE(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph) SET(PACKAGE_COMPONENT libopenscenegraph)
ENDIF(${ARGC} GREATER 1) ENDIF(${ARGC} GREATER 1)
# Add the VisualStudio versioning info # Add the VisualStudio versioning info
SET(TARGET_SRC ${TARGET_SRC} ${OPENSCENEGRAPH_VERSIONINFO_RC}) SET(TARGET_SRC ${TARGET_SRC} ${OPENSCENEGRAPH_VERSIONINFO_RC})
# here we use the command to generate the library # here we use the command to generate the library
IF (DYNAMIC_OPENSCENEGRAPH) IF (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H}) ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H}) ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF(DYNAMIC_OPENSCENEGRAPH)
IF(MSVC) #not sure if needed, but for plugins only Msvc need the d suffix
IF(NOT MSVC)
IF(NOT UNIX)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
ENDIF(NOT UNIX)
ELSE(NOT MSVC)
IF(NOT CMAKE24) IF(NOT CMAKE24)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed
ELSE(NOT CMAKE24) ELSE(NOT CMAKE24)
IF(OSG_MSVC_VERSIONED_DLL) IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR #this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property #the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there, #because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented #it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack #changing bin to something else breaks this hack
#the dll are placed in bin/${OSG_PLUGINS} #the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE) IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE) ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE) ENDIF(NOT MSVC_IDE)
@@ -330,34 +313,26 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
ENDIF(OSG_MSVC_VERSIONED_DLL) ENDIF(OSG_MSVC_VERSIONED_DLL)
ENDIF(NOT CMAKE24) ENDIF(NOT CMAKE24)
ENDIF(MSVC) ENDIF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES() SETUP_LINK_LIBRARIES()
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS} #the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
IF(WIN32) IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME} INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT}) LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
ELSE(WIN32) ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME} INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT}) LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
ENDIF(WIN32) ENDIF(WIN32)
ENDIF()
ENDMACRO(SETUP_PLUGIN) ENDMACRO(SETUP_PLUGIN)
@@ -367,10 +342,6 @@ ENDMACRO(SETUP_PLUGIN)
MACRO(SETUP_EXE IS_COMMANDLINE_APP) MACRO(SETUP_EXE IS_COMMANDLINE_APP)
#MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--") #MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
IF(GLCORE_FOUND)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
ENDIF()
IF(NOT TARGET_TARGETNAME) IF(NOT TARGET_TARGETNAME)
SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${TARGET_NAME}") SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${TARGET_NAME}")
ENDIF(NOT TARGET_TARGETNAME) ENDIF(NOT TARGET_TARGETNAME)
@@ -379,11 +350,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(NOT TARGET_LABEL) ENDIF(NOT TARGET_LABEL)
IF(${IS_COMMANDLINE_APP}) IF(${IS_COMMANDLINE_APP})
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H}) ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H})
ELSE(${IS_COMMANDLINE_APP}) ELSE(${IS_COMMANDLINE_APP})
IF(APPLE) IF(APPLE)
# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}") # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
# Short Version is the "marketing version". It is the version # Short Version is the "marketing version". It is the version
@@ -392,8 +363,6 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
# Bundle version is the version the OS looks at. # Bundle version is the version the OS looks at.
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}") SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" ) SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" )
# replace underscore by hyphen
STRING(REGEX REPLACE "_" "-" MACOSX_BUNDLE_GUI_IDENTIFIER ${MACOSX_BUNDLE_GUI_IDENTIFIER})
SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}" ) SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}" )
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns") # SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
# SET(MACOSX_BUNDLE_COPYRIGHT "") # SET(MACOSX_BUNDLE_COPYRIGHT "")
@@ -413,7 +382,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(APPLE) ENDIF(APPLE)
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H}) ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
ENDIF(${IS_COMMANDLINE_APP}) ENDIF(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
@@ -427,14 +396,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL) ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
IF(APPLE) SETUP_LINK_LIBRARIES()
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
ENDMACRO(SETUP_EXE) ENDMACRO(SETUP_EXE)
@@ -448,19 +410,15 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
ELSE(${ARGC} GREATER 1) ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0) SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1) ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP}) SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Applications") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Applications")
IF(APPLE) IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
ELSE(APPLE) ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
IF(MSVC)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE) ENDIF(APPLE)
ENDMACRO(SETUP_APPLICATION) ENDMACRO(SETUP_APPLICATION)
@@ -481,19 +439,15 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
ELSE(${ARGC} GREATER 1) ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0) SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1) ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP}) SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Examples") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Examples")
IF(APPLE) IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
ELSE(APPLE) ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
IF(MSVC)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE) ENDIF(APPLE)
ENDMACRO(SETUP_EXAMPLE) ENDMACRO(SETUP_EXAMPLE)
@@ -529,7 +483,7 @@ MACRO(HANDLE_MSVC_DLL)
ENDIF(${ARGC} GREATER 1) ENDIF(${ARGC} GREATER 1)
SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed
IF(NOT MSVC_IDE) IF(NOT MSVC_IDE)
IF (NOT CMAKE24) IF (NOT CMAKE24)
BUILDER_VERSION_GREATER(2 8 0) BUILDER_VERSION_GREATER(2 8 0)
IF(NOT VALID_BUILDER_VERSION) IF(NOT VALID_BUILDER_VERSION)
@@ -562,12 +516,8 @@ MACRO(HANDLE_MSVC_DLL)
ELSE (NOT CMAKE24) ELSE (NOT CMAKE24)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../") SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF (NOT CMAKE24) ENDIF (NOT CMAKE24)
ENDIF(NOT MSVC_IDE) ENDIF(NOT MSVC_IDE)
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-") # SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../") # SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDMACRO(HANDLE_MSVC_DLL) ENDMACRO(HANDLE_MSVC_DLL)
MACRO(REMOVE_CXX_FLAG flag)
STRING(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDMACRO()

113650
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
OpenSceneGraph Public License, Version 1.0 OpenSceneGraph Public License, Version 0.0
========================================== ==========================================
Copyright (C) 2018 Robert Osfield. Copyright (C) 2002 Robert Osfield.
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed. of this licence document, but changing it is not allowed.
@@ -12,19 +12,18 @@
This library is free software; you can redistribute it and/or modify it This library is free software; you can redistribute it and/or modify it
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
or later. or later.
Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1, Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
with the 4 exceptions laid out in the wxWindows section below. The LGPL is out in the wxWindows section below. The LGPL is contained in the
contained in the final section of this license. final section of this license.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
wxWindows Library Licence, Version 3
====================================
wxWindows Library Licence, Version 3.1 Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
======================================
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed. of this licence document, but changing it is not allowed.
@@ -44,20 +43,20 @@
You should have received a copy of the GNU Library General Public Licence You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not, along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02110-1301 USA. Boston, MA 02111-1307 USA.
EXCEPTION NOTICE EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give 1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of permission for additional uses of the text contained in this release of
the library as licenced under the wxWindows Library Licence, applying the library as licenced under the wxWindows Library Licence, applying
either version 3.1 of the Licence, or (at your option) any later version of either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version the Licence as published by the copyright holders of version 3 of the
3.1 of the Licence document. Licence document.
2. The exception is that you may use, copy, link, modify and distribute 2. The exception is that you may use, copy, link, modify and distribute
under your own terms, binary object code versions of works based under the user's own terms, binary object code versions of works based
on the Library. on the Library.
3. If you copy code from files distributed under the terms of the GNU 3. If you copy code from files distributed under the terms of the GNU
@@ -72,13 +71,11 @@
choice whether to permit this exception to apply to your modifications. choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly. code and/or adjust the licensing conditions notice accordingly.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc. Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -89,7 +86,7 @@
as the successor of the GNU Library Public License, version 2, hence as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.] the version number 2.1.]
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
@@ -134,7 +131,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be author's reputation will not be affected by problems that might be
introduced by others. introduced by others.
Finally, software patents pose a constant threat to the existence of Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a effectively restrict the users of a free program by obtaining a
@@ -190,8 +187,8 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The "work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must former contains code derived from the library, whereas the latter must
be combined with the library in order to run. be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other 0. This License Agreement applies to any software library or other
@@ -225,7 +222,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does. and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's 1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an you conspicuously and appropriately publish on each copy an
@@ -237,7 +234,7 @@ Library.
You may charge a fee for the physical act of transferring a copy, You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a and you may at your option offer warranty protection in exchange for a
fee. fee.
2. You may modify your copy or copies of the Library or any portion 2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
@@ -295,7 +292,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in that version instead if you wish.) Do not make any other change in
these notices. these notices.
Once this change is made in a given copy, it is irreversible for Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy. subsequent copies and derivative works made from that copy.
@@ -346,7 +343,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6. distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6, Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself. whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or 6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work work containing portions of the Library, and distribute that work
@@ -408,7 +405,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you use both them and the Library together in an executable that you
distribute. distribute.
7. You may place library facilities that are a work based on the 7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined facilities not covered by this License, and distribute such a combined
@@ -449,7 +446,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with You are not responsible for enforcing compliance by third parties with
this License. this License.
11. If, as a consequence of a court judgment or allegation of patent 11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
@@ -501,7 +498,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by license version number, you may choose any version ever published by
the Free Software Foundation. the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free 14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these, programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is write to the author to ask for permission. For software which is
@@ -511,7 +508,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing of all derivatives of our free software and of promoting the sharing
and reuse of software generally. and reuse of software generally.
NO WARRANTY NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -534,8 +531,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest If you develop a new library, and you want it to be of the greatest

129
NEWS.txt
View File

@@ -1,98 +1,9 @@
OSG News OSG News
======== ========
OpenSceneGraph 3.6 release
PERTHSHIRE, Scotland - 7th April 2018 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.6.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. The OpenSceneGraph is written entirely in Standard C++ and built upon OpenGL (1.2 to 4.6) and OpenGL ES (1.0 to 3.0), and offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets. OpenSceneGraph 3.6 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, Solaris, HP-UX, AIX and FreeBSD operating systems.
Updates include:
* OpenThreads::Affinity introduced to enable setting of processor affinity on viewer and database threads
* osgText rewritten to improve visual quality, add signed distance field support and full GLES2/3 and GL3/4 support
* Added VertexArrayObject support, enable full OpenGL Core Profile support under OSX.
* Added OpenCASCADE plugin
* Added STEP (.stp) plugin
* Improvements to FBX and COLLADA loaders
* Improvements to gles plugin to provide better Sketchfab support
* Added osgemscripten example
* Improvements to osgAnimation
* NodeVisitor ValueMap for storing values that can be stored and accessed across frames, such as update, event and cull traversals
* ShapeDrawable rewritten as an osg::Geometry to improve performance and flexibility
* Added osg::MultiDrawArrays support
* Added osgdeferred example that illustrates how to implement deferred rendering
* Added MultiDrawIndirect support
* Moved glDispatchCompute control out of osg::Program into a dedicated osg::DispatchCompute class to improve control of compute shaders
* KdTree support added for PolytopeIntersector, and ability to work with points, lines and polygons
* osgQt has been moved out to it's own dedicated osgQt github repository
* CMake build support for iOS bitcode builds
* CoverityScan testing introduced, fixes bring defect density to 0.0 per 1,0000 lines of code!
* Support for Codedoc automated documentation
* Support for Travis automated build system
Downloads and Licensing:
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found at http://www.openscenegraph.org/index.php/download-section/stable-releases and at our github repository https://github.com/openscenegraph/OpenSceneGraph/.
OpenSceneGraph is released under the OpenSceneGraph Public License, which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software. Further details http://www.openscenegraph.org/index.php/about/licensing
Professional support and services:
OpenSceneGraph project is backed up with professional services by OpenSceneGraph Professional Services, based in Scotland, and a range of Contractors from around the world http://www.openscenegraph.org/index.php/support/professional-support. For enquires email robert@openscenegraph.com. Services available include:
Confidential Professional Support
Bespoke development
Consultancy
Training
Community support and contributions:
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the 568 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
OpenSceneGraph 3.4 release introduces shader composition, new osgUI library, displacement mapping, volume rendering, lua scripting support and much more
PERTHSHIRE, Scotland - 12th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.4 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
Updates include:
* New #pragma(tic) composition shader functionality built into the core OSG that provides a easy to use yet flexible scheme for controlling and composing shaders at runtime levering GLSL support for #define and #pragma.
* New osgTerrain::DisplacementMappingTechnique to uses vertex, geometry and fragment shader based displacement mapping technique that dramatically lowers the CPU and GPU memory footprint and bandwidth needs for the same visual quality. The new scheme enables paged terrain that work robustly on smaller hardware, or with far higher loads without framedrops. This new technique levels #pragma(tic) shader composition to enable one to toggle on/off features in the shaders at runtime in a way that is as convenient to use as toggle modes in a fixed function pipeline scene graph.
* New osgVolume::MultipassTechique that uses multipass rendering and shaders to enable seamless mixing of traditional 3D geometry and volumes, support for geometry hulls that constrain where the volume should be rendered as well as improving the ray tracing shaders so that they are both faster and have higher visual quality than the previous generation of ray traced shaders supported by OSG-3.2 releases and before.
* New osgDB::Classiterface class that provides an easy to use mechanism for introspection of scene graph classes, allowing one to get, set properties and invoke methods in a generic way, making the task of integrating 3rd prarty tools such as scripting languages straight forward.
* New Lua scripting support via a plugin that integrates Lua 5.2.3 and the OSG via the OSG's native serialization codes.
* New osgUI NodeKit, that enables User Interface elements to be placed directly into 3D scene graph. The classes are fully scriptable so you create create UI and behaviours all within lua scripts.
* Improvements to OpenGL ES 1.1, ES 2.0 and ES3.0 support, including platform specific extensions
* Improvements to OpenGL 4.x support with a range of new extensions support
* Updates to osgQt to support Qt5 and provide better support for Qt4
Downloads and Licensing:
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the Downloads section of the openscenegraph.org website.
OpenSceneGraph is released under the OpenSceneGraph Public License, which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software.
Professional support and services
OpenSceneGraph project is backed up with professional services by OpenSceneGraph Professional Services, based in Scotland, and a range of Contractors from around the world. Services available include:
Confidential Professional Support
Bespoke development
Consultancy
Training
Community support and contributions:
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the 550 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
= !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more. = !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more.
PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs in both the desktop and mobile space. The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs in both the desktop and mobile space.
@@ -106,7 +17,7 @@ The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the op
* New OpenGL extensions support including compute shaders, tessellation shaders, integer array formats and associated Vec* classes, primitive restart * New OpenGL extensions support including compute shaders, tessellation shaders, integer array formats and associated Vec* classes, primitive restart
* Improvements to osgManipulator NodeKit that introduce new manipulators and improve flexibility and customizability * Improvements to osgManipulator NodeKit that introduce new manipulators and improve flexibility and customizability
* Updates to osgQt to support Qt5 and provide better support for Qt4 * Updates to osgQt to support Qt5 and provide better support for Qt4
* New osgGA::Device base class for receiving from and sending events to both real and virtual devices in a generic, extensible way * New osgGA::Device base class for recieving from and sending events to both real and virtual devices in a generic, extensible way
* New ZeroConf, RestHTTP and OSC plugins to enable remote control of applications such as controlling desktop systems from tablets and phones * New ZeroConf, RestHTTP and OSC plugins to enable remote control of applications such as controlling desktop systems from tablets and phones
* Improvements to osgVolume NodeKit and DICOM plugin for better medical visualization * Improvements to osgVolume NodeKit and DICOM plugin for better medical visualization
* New TrackVis .trk track files plugin for the visualization of brain scans. * New TrackVis .trk track files plugin for the visualization of brain scans.
@@ -143,7 +54,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme
= !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more. = !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more.
PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 3.0 release is the culmination of 12 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The !OpenSceneGraph 3.0 release is the culmination of 12 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -198,7 +109,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme
= !OpenSceneGraph 2.8 release adds osgAnimation and osgVolume libraries, DICOM support, LispSM shadowing and much more. = = !OpenSceneGraph 2.8 release adds osgAnimation and osgVolume libraries, DICOM support, LispSM shadowing and much more. =
PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.8 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The !OpenSceneGraph 2.8 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -269,7 +180,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. = = !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -338,7 +249,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= !OpenSceneGraph 2.4 release adds geometry shaders, multiple render targets, support for terrabyte scale terrain databases, writing to !OpenFlight and much more. = = !OpenSceneGraph 2.4 release adds geometry shaders, multiple render targets, support for terrabyte scale terrain databases, writing to !OpenFlight and much more. =
PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.4 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The !OpenSceneGraph 2.4 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -394,7 +305,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= OpenSceneGraph 2.2 release adds support for advanced displays, soft and parallel split shadow maps and easier builds = = OpenSceneGraph 2.2 release adds support for advanced displays, soft and parallel split shadow maps and easier builds =
PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems. PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance === === Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.2 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The !OpenSceneGraph 2.2 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -451,7 +362,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
!!![=OpenSceneGraph=] 2.0 release improves ease-of-use and scalability, introducing new osgViewer, osgShadow and osgManipulator libraries, new build system, improved multi-core, multi-GPU support. !!![=OpenSceneGraph=] 2.0 release improves ease-of-use and scalability, introducing new osgViewer, osgShadow and osgManipulator libraries, new build system, improved multi-core, multi-GPU support.
PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real-time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real-time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
!!!Open-source development delivers industry-leading features and performance !!!Open-source development delivers industry-leading features and performance
The [=OpenSceneGraph=] 2.0 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. The [=OpenSceneGraph=] 2.0 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -509,7 +420,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!![=OpenSceneGraph=] 1.2 release introduces Windows 64bit and AIX support, COLLADA support, processor affinity and texture atlas builder. !!![=OpenSceneGraph=] 1.2 release introduces Windows 64bit and AIX support, COLLADA support, processor affinity and texture atlas builder.
PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.2, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.2, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
The [=OpenSceneGraph=]-1.2 release introduces: The [=OpenSceneGraph=]-1.2 release introduces:
@@ -534,7 +445,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!!OpenSceneGraph 1.1 release introduces peformance and scalability improvements, full OpenGL Shading Language support and new OpenFlight 16.1, TerrPagea2.2 and Quake3 loaders. !!!OpenSceneGraph 1.1 release introduces peformance and scalability improvements, full OpenGL Shading Language support and new OpenFlight 16.1, TerrPagea2.2 and Quake3 loaders.
AYRSHIRE, Scotland - July 19th 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.1, AYRSHIRE, Scotland - July 19th 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.1,
the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
The OpenSceneGraph-1.1 release introduces: The OpenSceneGraph-1.1 release introduces:
@@ -561,7 +472,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!!High performance open-source graphics toolkit [=OpenSceneGraph=] hits 1.0! !!!High performance open-source graphics toolkit [=OpenSceneGraph=] hits 1.0!
AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
->''"3Dlabs congratulates the [=OpenSceneGraph=] development community on the release of [=OpenSceneGraph=] 1.0. [=OpenSceneGraph=] is a shining example of how open-source projects can deliver commercial-quality products with outstanding performance and a ton of cutting-edge features. 3Dlabs committed engineering resources to [=OpenSceneGraph=] to help implement full support of programmable shader technology through [=OpenGL=] Shading Language. It is gratifying to see the excitement that developers have for this important cross-platform, real-time visualization library."'''\\ ->''"3Dlabs congratulates the [=OpenSceneGraph=] development community on the release of [=OpenSceneGraph=] 1.0. [=OpenSceneGraph=] is a shining example of how open-source projects can deliver commercial-quality products with outstanding performance and a ton of cutting-edge features. 3Dlabs committed engineering resources to [=OpenSceneGraph=] to help implement full support of programmable shader technology through [=OpenGL=] Shading Language. It is gratifying to see the excitement that developers have for this important cross-platform, real-time visualization library."'''\\
Randi Rost, director of developer relations at 3Dlabs, http://developer.3Dlabs.com/ Randi Rost, director of developer relations at 3Dlabs, http://developer.3Dlabs.com/
@@ -688,7 +599,7 @@ osgpbuffer also example now uses Producer's pbuffer support making it portable a
API refinements, bug fixes and performance improvements: API refinements, bug fixes and performance improvements:
There have been many bug fixes, a number of performance improvements and API cleanups that have occurred throughout the 0.9.8 - 0.9.9, too many separate items to enumerate here. Together with the above new features they all go to making the OpenSceneGraph-0.9.9 the most robust, high performance and feature rich version so far, and sets the stage for the upcoming 1.0. There have been many bug fixes, a number of performance improvements and API cleanups that have occured throughout the 0.9.8 - 0.9.9, too many separate items to enumerate here. Together with the above new features they all go to making the OpenSceneGraph-0.9.9 the most robust, high performance and feature rich version so far, and sets the stage for the upcoming 1.0.
We would like to thank the following engineers for their contributions in the 0.9.8 - 0.9.9.9 time frame (in alphabetic order): We would like to thank the following engineers for their contributions in the 0.9.8 - 0.9.9.9 time frame (in alphabetic order):
Alberto Farre, Bob Kuehne, Brede Johansen, Carlo Camporesi, Chris Hanson, Don Burns, Donn Mielcarek, Don Tidrow, Farshid Lashkari, Frederic Marmond, Garrett Potts, Igor Kravtchenko, James French, Jan Ciger, John Grant, Joakim Simonsson, Joran Jessurun, Jason Daly, Kevin Moiule, Leandro Motta Barros, Marco Jez, Mason Menninger, Mike Weiblen, Nathan Monteleone, Norman Vine, Olaf Flebbe, Paul Melis, Per Fahlberg, Rainer Oder, Randall Hopper, Reinhard Sainitzer, Robert Osfield, Ruben, Sebastien Grignard, Stephan Huber, Terry Welsh, Thom DeCarlo, Tony Horrobin, Tree, Tugkan Calapoglu, Vivek Rajan, Waltice and Yuzhong Shen Alberto Farre, Bob Kuehne, Brede Johansen, Carlo Camporesi, Chris Hanson, Don Burns, Donn Mielcarek, Don Tidrow, Farshid Lashkari, Frederic Marmond, Garrett Potts, Igor Kravtchenko, James French, Jan Ciger, John Grant, Joakim Simonsson, Joran Jessurun, Jason Daly, Kevin Moiule, Leandro Motta Barros, Marco Jez, Mason Menninger, Mike Weiblen, Nathan Monteleone, Norman Vine, Olaf Flebbe, Paul Melis, Per Fahlberg, Rainer Oder, Randall Hopper, Reinhard Sainitzer, Robert Osfield, Ruben, Sebastien Grignard, Stephan Huber, Terry Welsh, Thom DeCarlo, Tony Horrobin, Tree, Tugkan Calapoglu, Vivek Rajan, Waltice and Yuzhong Shen
@@ -707,7 +618,7 @@ OpenProducer - http://www.andesengineering.com/Producer/index.html
OpenThreads - http://openthreads.sf.net OpenThreads - http://openthreads.sf.net
xine-lib - http://xinehq.de/ xine-lib - http://xinehq.de/
OpenSceneGraph Commercial Support, Training and Consultancy links: OpenSceneGraph Commericial Support, Training and Consultancy links:
OpenSceneGraph Professional Services - http://www.openscenegraph.com OpenSceneGraph Professional Services - http://www.openscenegraph.com
Andes Engineering - http://www.andesengineering.com Andes Engineering - http://www.andesengineering.com
@@ -721,7 +632,7 @@ Andes Engineering - http://www.andesengineering.com
>>> Support for database archives, improved pager, 3d compressed textures >>> Support for database archives, improved pager, 3d compressed textures
Release 0.9.8 reflects a continuation of the prior commitment to release Release 0.9.8 reflects a continuation of the prior committment to release
often, arriving only two short months after 0.9.7. This contrasts sharply often, arriving only two short months after 0.9.7. This contrasts sharply
to the long period between 0.9.6-2 and 0.9.7. The following set of to the long period between 0.9.6-2 and 0.9.7. The following set of
improvements and features are part of the 0.9.8 release. improvements and features are part of the 0.9.8 release.
@@ -1136,7 +1047,7 @@ Andes Engineering - http://www.andesengineering.com
has now been moved to a freetype plug-in which is dynamically loaded on demand, has now been moved to a freetype plug-in which is dynamically loaded on demand,
with the core osgText library providing a default font when the plug-in is with the core osgText library providing a default font when the plug-in is
unavailable. Moving the freetype dependency out of the osgText library makes unavailable. Moving the freetype dependency out of the osgText library makes
it just dependent on OpenGL and Standard C++ like the rest of the core libraries, it just dependant on OpenGL and Standard C++ like the rest of the core libraries,
allowing osgText to compile by default on all platforms. allowing osgText to compile by default on all platforms.
Improved thread safety has also been achieved in the core osg and osgUtil libraries Improved thread safety has also been achieved in the core osg and osgUtil libraries
@@ -1561,9 +1472,9 @@ Andes Engineering - http://www.andesengineering.com
Scene graph optimization has been added which can boost performance Scene graph optimization has been added which can boost performance
on some database by as much as an order of magnititude, this is on some database by as much as an order of magnititude, this is
particularly noticeable in .flt based databases. Display list performance particularily noticable in .flt based databases. Display list performance
has also been boosted on NVidia based machines thanks to changing the has also been boosted on NVidia based machines thanks to changing the
compilation and execution of display list into two separate operations. compilation and execution of display list into two seperate operations.
App callbacks are now supported on all Nodes, and there now a proper App callbacks are now supported on all Nodes, and there now a proper
app traversal which can be used to animate the scene. app traversal which can be used to animate the scene.
@@ -1613,7 +1524,7 @@ Andes Engineering - http://www.andesengineering.com
the core scene graph library making extremely easy to take advantage of the core scene graph library making extremely easy to take advantage of
this advanced rendering techinque - normally only seen in research papers. this advanced rendering techinque - normally only seen in research papers.
Check out osgimpostor demo to see how easy it is to add osg::Impostor Check out osgimpostor demo to see how easy it is to add osg::Impostor
nodes to your own models. Impostors are particularly effective are nodes to your own models. Impostors are particularily effective are
reducing scene complexity whilest minimizing the visual impact, making it reducing scene complexity whilest minimizing the visual impact, making it
ideal for scenes with large numbers of complex objects such as a city ideal for scenes with large numbers of complex objects such as a city
scene, or a dense forest. scene, or a dense forest.
@@ -1624,7 +1535,7 @@ Andes Engineering - http://www.andesengineering.com
The cool thing about both the osgreflect and osgimpostor demos is that The cool thing about both the osgreflect and osgimpostor demos is that
there is no hardwiring to achieve the results, the scene graph stores there is no hardwiring to achieve the results, the scene graph stores
all the information necessary to specify the number and type of rendering all the information neccessary to specify the number and type of rendering
passes, and the framework handles the rest behind the scenes. This also passes, and the framework handles the rest behind the scenes. This also
makes it very easy to add these advanced rendering techinques to your makes it very easy to add these advanced rendering techinques to your
own applications as everything is cleanly encapsulated with own applications as everything is cleanly encapsulated with
@@ -1636,7 +1547,7 @@ Andes Engineering - http://www.andesengineering.com
web or your own. web or your own.
osg::Camera has been totally revamped and now supports asymetric osg::Camera has been totally revamped and now supports asymetric
and othographics projections in addition to the symmetrical perspective and othographics projections in addition to the symetrical perspective
projections. projections.
And finally, support for texture subloading has been added to osg::Texture And finally, support for texture subloading has been added to osg::Texture

View File

@@ -4,7 +4,7 @@ APP_PROJECT_PATH := $(call my-dir)
APP_OPTIM := ${ANDROID_RELEASE_OPTIM} APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
APP_PLATFORM := android-${ANDROID_PLATFORM} APP_PLATFORM := ${ANDROID_PLATFORM}
APP_STL := ${ANDROID_STL} APP_STL := ${ANDROID_STL}
APP_CPPFLAGS := -fexceptions -frtti APP_CPPFLAGS := -fexceptions -frtti
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums #APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums

File diff suppressed because it is too large Load Diff

119
README.md
View File

@@ -1,119 +0,0 @@
[![Build Status](https://travis-ci.org/openscenegraph/OpenSceneGraph.svg?branch=master)](https://travis-ci.org/openscenegraph/OpenSceneGraph)
[![Coverity Status](https://scan.coverity.com/projects/9159/badge.svg)](https://scan.coverity.com/projects/openscenegraph-openscenegraph)
[![Documentation](https://codedocs.xyz/openscenegraph/OpenSceneGraph.svg)](https://codedocs.xyz/openscenegraph/OpenSceneGraph/)
[ABI Tracker](https://abi-laboratory.pro/tracker/timeline/openscenegraph/ "ABI Tracker")
# Introduction
Welcome to the OpenSceneGraph (OSG).
For up-to-date information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:
http://www.openscenegraph.org/index.php/documentation
For support subscribe to our public mailing list or forum, details at:
http://www.openscenegraph.org/index.php/support
For the impatient, we've included quick build instructions below, these are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) macOS release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for more indepth instructions.
Robert Osfield.
Project Lead.
29th June 2018.
---
## Section 1. How to build OpenSceneGraph
The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the `CMakeLists.txt` files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system.
If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the `cmake` or `ccmake` command-line utils. Note that `cmake .` defaults to building Release to ensure that you get the best performance from your final libraries/applications.
cd OpenSceneGraph
cmake .
make
sudo make install
Alternatively, you can create an out-of-source build directory and run cmake or ccmake from there. The advantage to this approach is that the temporary files created by CMake won't clutter the OpenSceneGraph source directory, and also makes it possible to have multiple independent build targets by creating multiple build directories. In a directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below.
For further details on compilation, installation and platform-specific information read "Getting Started" guide:
http://www.openscenegraph.org/index.php/documentation/10-getting-started
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
There are two ways to compile OpenSceneGraph under macOS. The recommended way is to use CMake to generate Xcode project files and then use Xcode to build the library. The default project will be able to build Debug or Release libraries, examples, and sample applications.
The alternative is to build OpenSceneGraph from the command line using `make` or `ninja` using the instructions for Unix-like systems above.
Here are some key settings to consider when using CMake:
- BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on to compile many great example programs.
- CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables, libraries, and frameworks that can be run on more than one architecture. Use this setting to indicate the architectures on which to build OSG. x86_64 is the only supported value for OS versions > 10.7.
- OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are created for the examples and sample applications. Turn this option on if you want to create real macOS .app bundles. There are caveats to creating `.app` bundles, see below.
- OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX - By default macOS uses the `imageio` plugin instead of the plugins for the individual file types (e.g. `jpg`, `gif`, etc.) to load image file types. The `imageio` plugin can handle all popular file formats through the ImageIO framework.
- OSG_WINDOWING_SYSTEM - You have the choice to use Cocoa, Carbon, or X11 when building applications on macOS. Cocoa is the default for OS versions >= 10.5. Carbon and X11 are no longer actively supported, either by Apple or the OSG community.
### APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the executable file. They do not contain the dependent libraries as would a normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable OSG_LIBRARY_PATH may be set to point to the location where the plugin .so files are located. OSG_FILE_PATH may be set to point to the location where data files are located. Setting OSG_FILE_PATH to the OpenSceneGraph-Data directory is very useful when testing OSG by running the example programs.
Many of the example programs use command-line arguments. When double-clicking on an application (or using the equivalent "open" command on the command line) only those examples and applications that do not require command-line arguments will successfully run. The executable file within the .app bundle can be run from the command-line if command-line arguments are needed.
## Section 3. Release notes on iOS build, by Thomas Hogarth
With CMake, XCode and the iOS sdk installed you can generate an iOS XCode project using the following command line:
export THIRDPARTY_PATH=/path/to/my/3rdParty
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="10.2" \
-DIPHONE_VERSION_MIN="8.0" \
-DOPENGL_PROFILE:STRING=GLES2 \
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-DDYNAMIC_OPENTHREADS:BOOL=OFF \
-DCURL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/curl-ios-device/include" \
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreeType_iphone_universal.a" \
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 10.2. IPHONE_VERSION_MIN controls the base sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team. In the 'Build Settings' tab search for 'Other Linker Flags', then for each target type (debug, release etc) that you want to use open the list of arguments and delete the 'OpenGL' line and the '-framework' line above it. This is because cmake has tried to add the desktop OpenGL library which we don't want.
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.

210
README.txt Normal file
View File

@@ -0,0 +1,210 @@
Welcome to the OpenSceneGraph (OSG).
For up-to-date information on the project, in-depth details on how to
compile and run libraries and examples, see the documentation on the
OpenSceneGraph website:
http://www.openscenegraph.org/index.php/documentation
For support subscribe to our public mailing list or forum, details at:
http://www.openscenegraph.org/index.php/support
For the impatient, we've included quick build instructions below, these
are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) OSX release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org
to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for
more indepth instructions.
Robert Osfield.
Project Lead.
24th July 2013.
--
Section 1. How to build the OpenSceneGraph
==========================================
The OpenSceneGraph uses the CMake build system to generate a
platform-specific build environment. CMake reads the CMakeLists.txt
files that you'll find throughout the OpenSceneGraph directories,
checks for installed dependenciesand then generates the appropriate
build system.
If you don't already have CMake installed on your system you can grab
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
use the cmake or ccmake command-line utils, or use the included tiny
configure script that'll run cmake for you. The configure script
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
get the best performance from your final libraries/applications.
cd OpenSceneGraph
./configure
make
sudo make install
Alternatively, you can create an out-of-source build directory and run
cmake or ccmake from there. The advantage to this approach is that the
temporary files created by CMake won't clutter the OpenSceneGraph
source directory, and also makes it possible to have multiple
independent build targets by creating multiple build directories. In a
directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph -DCMAKE_BUILD_TYPE=Release
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
files. The following page on our wiki dedicated to the CMake build
system should help guide you through the process:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/index.php/documentation/10-getting-started
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
=========================================================================
There are several ways to compile OpenSceneGraph under OSX. The
recommended way is to use CMake 2.6 to generate Xcode projects, then use
Xcode to build the library. The default project will be able to build
Debug or Release libraries, examples, and sample applications. Here are
some key settings to consider when using CMake:
BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on
to compile many great example programs.
CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables,
libraries, and frameworks that can be run on more than one architecture.
Use this setting to indicate the architectures on which to build OSG.
Possibilities include ppc, ppc64, i386, and x86_64. Building OSG using
either of the 64-bit options (ppc64 and x86_64) has its own caveats
below.
OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are
created for the examples and sample applications. Turn this option on if
you want to create real OSX .app bundles. There are caveats to creating
.app bundles, see below.
OSG_WINDOWING_SYSTEM - You have the choice to use Carbon or X11 when
building applications on OSX. Under Leopard and later, X11 applications,
when started, will automatically launch X11 when needed. However,
full-screen X11 applications will still show the menu bar at the top of
the screen. Since many parts of the Carbon user interface are not
64-bit, X11 is the only supported option for OSX applications compiled
for ppc64 or x86_64.
There is an Xcode directory in the base of the OSG software
distribution, but its future is limited, and will be discontinued once
the CMake project generator completely implements its functionality.
APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the
executable file. They do not contain the dependent libraries as would a
normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable
OSG_LIBRARY_PATH may be set to point to the location where the plugin
.so files are located. OSG_FILE_PATH may be set to point to the location
where data files are located. Setting OSG_FILE_PATH to the
OpenSceneGraph-Data directory is very useful when testing OSG by running
the example programs.
Many of the example programs use command-line arguments. When
double-clicking on an application (or using the equivalent "open"
command on the command line) only those examples and applications that
do not require command-line arguments will successfully run. The
executable file within the .app bundle can be run from the command-line
if command-line arguments are needed.
64-BIT APPLICATION SUPPORT
OpenSceneGraph will not compile successfully when OSG_WINDOWING_SYSTEM is
Carbon and either x86_64 or ppc64 is selected under CMAKE_OSX_ARCHITECTURES,
as Carbon is a 32bit only API. A version of the osgviewer library written in
Cocoa is needed. However, OSG may be compiled under 64-bits if the X11
windowing system is selected. However, Two parts of the OSG default
distribution will not work with 64-bit X11: the osgviewerWX example
program and the osgdb_qt (Quicktime) plugin. These must be removed from
the Xcode project after Cmake generates it in order to compile with
64-bit architectures. The lack of the latter means that images such as
jpeg, tiff, png, and gif will not work, nor will animations dependent on
Quicktime. A new ImageIO-based plugin is being developed to handle the
still images, and a QTKit plugin will need to be developed to handle
animations.
Section 3. Release notes on iOS build, by Thomas Hoghart
=========================================================
* Run CMake with either OSG_BUILD_PLATFORM_IPHONE or OSG_BUILD_PLATFORM_IPHONE_SIMULATOR set:
$ mkdir build-iOS ; cd build-iOS
$ ccmake -DOSG_BUILD_PLATFORM_IPHONE_SIMULATOR=YES -G Xcode ..
* Check that CMAKE_OSX_ARCHITECTURE is i386 for the simulator or armv6;armv7 for the device
* Disable DYNAMIC_OPENSCENEGRAPH, DYNAMIC_OPENTHREADS
This will give us the static build we need for iPhone.
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
* Change FREETYPE include and library paths to an iPhone version
(OpenFrameworks has one bundled with its distribution)
* Ensure that CMake_OSX_SYSROOT points to your iOS SDK.
* Generate the Xcode project
* Open the Xcode project
$ open OpenSceneGraph.xcodeproj
* Under Sources -> osgDB, select FileUtils.cpp and open the 'Get Info' panel, change File Type
to source.cpp.objcpp
Here's an example for the command-line:
$ cmake -G Xcode \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING="-ftree-vectorize -fvisibility-inlines-hidden -mno-thumb -arch armv6 -pipe -no-cpp-precomp -miphoneos-version-min=3.1 -mno-thumb" \
-D BUILD_OSG_APPLICATIONS:BOOL=OFF \
-D OSG_BUILD_FRAMEWORKS:BOOL=OFF \
-D OSG_WINDOWING_SYSTEM:STRING=IOS \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_OSX_ARCHITECTURES:STRING="armv6;armv7" \
-D CMAKE_OSX_SYSROOT:STRING=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk \
-D OSG_GL1_AVAILABLE:BOOL=OFF \
-D OSG_GL2_AVAILABLE:BOOL=OFF \
-D OSG_GLES1_AVAILABLE:BOOL=ON \
-D OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-D OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
-D OSG_GL_LIBRARY_STATIC:BOOL=OFF \
-D OSG_GL_MATRICES_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-D DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-D DYNAMIC_OPENTHREADS:BOOL=OFF .
Known issues:
* When Linking final app against ive plugin, you need to add -lz to
the 'Other linker flags' list.
* Apps and exes don't get created
* You can only select Simulator, or Device projects. In the XCode
project you will see both types but the sdk they link will
be the same.

View File

@@ -1,9 +1,9 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
* *
* This application is open source and may be redistributed and/or modified * This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications, * freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained. * as long as this copyright notice is maintained.
* *
* This application is distributed in the hope that it will be useful, * This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -26,12 +26,12 @@ int main( int argc, char **argv )
{ {
// use an ArgumentParser object to manage the program arguments. // use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program. // set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications.."); arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
// if user request help write it out to cout. // if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help")) if (arguments.read("-h") || arguments.read("--help"))
{ {
@@ -49,14 +49,14 @@ int main( int argc, char **argv )
{ {
insert = true; insert = true;
} }
bool extract = false; bool extract = false;
while (arguments.read("-e") || arguments.read("--extract")) while (arguments.read("-e") || arguments.read("--extract"))
{ {
extract = true; extract = true;
} }
bool list = false; bool list = false;
while (arguments.read("-l") || arguments.read("--list")) while (arguments.read("-l") || arguments.read("--list"))
{ {
list = true; list = true;
@@ -93,7 +93,7 @@ int main( int argc, char **argv )
} }
} }
} }
// any option left unread are converted into errors to write out later. // any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized(); arguments.reportRemainingOptionsAsUnrecognized();
@@ -103,7 +103,7 @@ int main( int argc, char **argv )
arguments.writeErrorMessages(std::cout); arguments.writeErrorMessages(std::cout);
return 1; return 1;
} }
if (archiveFilename.empty()) if (archiveFilename.empty())
{ {
std::cout<<"Please specify an archive name using --archive filename"<<std::endl; std::cout<<"Please specify an archive name using --archive filename"<<std::endl;
@@ -115,7 +115,7 @@ int main( int argc, char **argv )
std::cout<<"Please specify an operation on the archive, either --insert, --extract or --list"<<std::endl; std::cout<<"Please specify an operation on the archive, either --insert, --extract or --list"<<std::endl;
return 1; return 1;
} }
if (insert && extract) if (insert && extract)
{ {
std::cout<<"Cannot insert and extract files from the archive at one time, please use either --insert or --extract."<<std::endl; std::cout<<"Cannot insert and extract files from the archive at one time, please use either --insert or --extract."<<std::endl;
@@ -127,7 +127,7 @@ int main( int argc, char **argv )
if (insert) if (insert)
{ {
archive = osgDB::openArchive(archiveFilename, osgDB::Archive::WRITE); archive = osgDB::openArchive(archiveFilename, osgDB::Archive::WRITE);
if (archive.valid()) if (archive.valid())
{ {
for (FileNameList::iterator itr=files.begin(); for (FileNameList::iterator itr=files.begin();
@@ -135,7 +135,7 @@ int main( int argc, char **argv )
++itr) ++itr)
{ {
std::cout<<"reading "<<*itr<<std::endl; std::cout<<"reading "<<*itr<<std::endl;
osg::ref_ptr<osg::Object> obj = osgDB::readRefObjectFile(*itr); osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(*itr);
if (obj.valid()) if (obj.valid())
{ {
std::cout<<" write to archive "<<*itr<<std::endl; std::cout<<" write to archive "<<*itr<<std::endl;
@@ -152,10 +152,10 @@ int main( int argc, char **argv )
} }
} }
} }
else else
{ {
archive = osgDB::openArchive(archiveFilename, osgDB::Archive::READ); archive = osgDB::openArchive(archiveFilename, osgDB::Archive::READ);
if (extract && archive.valid()) if (extract && archive.valid())
{ {
for (FileNameList::iterator itr=files.begin(); for (FileNameList::iterator itr=files.begin();
@@ -175,7 +175,7 @@ int main( int argc, char **argv )
} }
if (list && archive.valid()) if (list && archive.valid())
{ {
std::cout<<"List of files in archive:"<<std::endl; std::cout<<"List of files in archive:"<<std::endl;
osgDB::Archive::FileNameList fileNames; osgDB::Archive::FileNameList fileNames;
if (archive->getFileNames(fileNames)) if (archive->getFileNames(fileNames))
@@ -187,11 +187,11 @@ int main( int argc, char **argv )
std::cout<<" "<<*itr<<std::endl; std::cout<<" "<<*itr<<std::endl;
} }
} }
std::cout<<std::endl; std::cout<<std::endl;
std::cout<<"Master file "<<archive->getMasterFileName()<<std::endl; std::cout<<"Master file "<<archive->getMasterFileName()<<std::endl;
} }
return 0; return 0;
} }

View File

@@ -157,7 +157,6 @@ public:
} }
osg::ref_ptr<osg::State> state = new osg::State; osg::ref_ptr<osg::State> state = new osg::State;
state->initializeExtensionProcs();
for(TextureSet::iterator itr=_textureSet.begin(); for(TextureSet::iterator itr=_textureSet.begin();
itr!=_textureSet.end(); itr!=_textureSet.end();
@@ -175,7 +174,7 @@ public:
{ {
texture->setInternalFormatMode(_internalFormatMode); texture->setInternalFormatMode(_internalFormatMode);
// need to disable the unref after apply, otherwise the image could go out of scope. // need to disable the unref after apply, other the image could go out of scope.
bool unrefImageDataAfterApply = texture->getUnRefImageDataAfterApply(); bool unrefImageDataAfterApply = texture->getUnRefImageDataAfterApply();
texture->setUnRefImageDataAfterApply(false); texture->setUnRefImageDataAfterApply(false);
@@ -374,6 +373,16 @@ public:
++_numStateSetRemoved; ++_numStateSetRemoved;
} }
for(unsigned int i=0;i<node.getNumDrawables();++i)
{
osg::Drawable* drawable = node.getDrawable(i);
if (drawable && drawable->getStateSet())
{
drawable->setStateSet(0);
++_numStateSetRemoved;
}
}
traverse(node); traverse(node);
} }
@@ -548,7 +557,6 @@ int main( int argc, char **argv )
// if user request help write it out to cout. // if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help")) if (arguments.read("-h") || arguments.read("--help"))
{ {
osg::setNotifyLevel(osg::NOTICE);
usage( arguments.getApplicationName().c_str(), 0 ); usage( arguments.getApplicationName().c_str(), 0 );
//arguments.getApplicationUsage()->write(std::cout); //arguments.getApplicationUsage()->write(std::cout);
return 1; return 1;
@@ -625,19 +633,13 @@ int main( int argc, char **argv )
while (arguments.read("-e",ext)) while (arguments.read("-e",ext))
{ {
std::string libName = osgDB::Registry::instance()->createLibraryNameForExtension(ext); std::string libName = osgDB::Registry::instance()->createLibraryNameForExtension(ext);
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED) osgDB::Registry::instance()->loadLibrary(libName);
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
} }
std::string libName; std::string libName;
while (arguments.read("-l",libName)) while (arguments.read("-l",libName))
{ {
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED) osgDB::Registry::instance()->loadLibrary(libName);
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
} }
while (arguments.read("-o",str)) while (arguments.read("-o",str))
@@ -740,7 +742,7 @@ int main( int argc, char **argv )
while(arguments.read("--addMissingColours") || arguments.read("--addMissingColors")) { addMissingColours = true; } while(arguments.read("--addMissingColours") || arguments.read("--addMissingColors")) { addMissingColours = true; }
bool do_overallNormal = false; bool do_overallNormal = false;
while(arguments.read("--overallNormal")) { do_overallNormal = true; } while(arguments.read("--overallNormal") || arguments.read("--overallNormal")) { do_overallNormal = true; }
bool enableObjectCache = false; bool enableObjectCache = false;
while(arguments.read("--enable-object-cache")) { enableObjectCache = true; } while(arguments.read("--enable-object-cache")) { enableObjectCache = true; }
@@ -778,7 +780,7 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick(); osg::Timer_t startTick = osg::Timer::instance()->tick();
osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames); osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(fileNames);
if (root.valid()) if (root.valid())
{ {
@@ -814,7 +816,7 @@ int main( int argc, char **argv )
root->accept(av); root->accept(av);
} }
// optimize the scene graph, remove redundant nodes and state etc. // optimize the scene graph, remove rendundent nodes and state etc.
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(root.get()); optimizer.optimize(root.get());
@@ -823,7 +825,7 @@ int main( int argc, char **argv )
if (internalFormatMode != osg::Texture::USE_IMAGE_DATA_FORMAT) if (internalFormatMode != osg::Texture::USE_IMAGE_DATA_FORMAT)
{ {
ext = osgDB::getFileExtension(fileNameOut); std::string ext = osgDB::getFileExtension(fileNameOut);
CompressTexturesVisitor ctv(internalFormatMode); CompressTexturesVisitor ctv(internalFormatMode);
root->accept(ctv); root->accept(ctv);
ctv.compress(); ctv.compress();

View File

@@ -1,9 +1,9 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
* *
* This application is open source and may be redistributed and/or modified * This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications, * freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained. * as long as this copyright notice is maintained.
* *
* This application is distributed in the hope that it will be useful, * This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -32,10 +32,7 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <OpenThreads/Atomic> static bool s_ExitApplication = false;
static OpenThreads::Atomic s_ExitApplication;
static OpenThreads::Atomic s_SigValue;
struct Extents struct Extents
{ {
@@ -49,20 +46,20 @@ struct Extents
_maxLevel(maxLevel), _maxLevel(maxLevel),
_min(minX, minY), _min(minX, minY),
_max(maxX, maxY) {} _max(maxX, maxY) {}
Extents(const Extents& extents): Extents(const Extents& extents):
_maxLevel(extents._maxLevel), _maxLevel(extents._maxLevel),
_min(extents._min), _min(extents._min),
_max(extents._max) {} _max(extents._max) {}
Extents& operator = (const Extents& rhs) Extents& operator = (const Extents& rhs)
{ {
if (&rhs == this) return *this; if (&rhs == this) return *this;
_maxLevel = rhs._maxLevel; _maxLevel = rhs._maxLevel;
_min = rhs._min; _min = rhs._min;
_max = rhs._max; _max = rhs._max;
return *this; return *this;
} }
@@ -72,10 +69,10 @@ struct Extents
osg::notify(osg::INFO)<<" _maxLevel="<<_maxLevel<<", _min="<<_min<<" _max="<<_max<<std::endl; osg::notify(osg::INFO)<<" _maxLevel="<<_maxLevel<<", _min="<<_min<<" _max="<<_max<<std::endl;
if (level>_maxLevel) return false; if (level>_maxLevel) return false;
osg::Vec2d union_min, union_max; osg::Vec2d union_min, union_max;
// handle mins // handle mins
if (_min.x()!=DBL_MAX && in_min.x()!=DBL_MAX) if (_min.x()!=DBL_MAX && in_min.x()!=DBL_MAX)
{ {
// both _min.x() and in_min.x() are defined so use max of two // both _min.x() and in_min.x() are defined so use max of two
@@ -98,7 +95,7 @@ struct Extents
union_min.y() = _min.y()<in_min.y() ? _min.y() : in_min.y(); union_min.y() = _min.y()<in_min.y() ? _min.y() : in_min.y();
} }
// handle maxs // handle maxs
if (_max.x()!=-DBL_MAX && in_max.x()!=-DBL_MAX) if (_max.x()!=-DBL_MAX && in_max.x()!=-DBL_MAX)
{ {
// both _max.x() and in_max.x() are defined so use max of two // both _max.x() and in_max.x() are defined so use max of two
@@ -124,7 +121,7 @@ struct Extents
bool result = union_min.x()<union_max.x() && union_min.y()<union_max.y() ; bool result = union_min.x()<union_max.x() && union_min.y()<union_max.y() ;
osg::notify(osg::INFO)<<" union_min="<<union_min<<" union_max="<<union_max<<" result = "<<result<<std::endl; osg::notify(osg::INFO)<<" union_min="<<union_min<<" union_max="<<union_max<<" result = "<<result<<std::endl;
return result; return result;
} }
@@ -143,7 +140,7 @@ public:
_currentLevel(0) {} _currentLevel(0) {}
void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; } void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; }
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY) void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
{ {
_extentsList.push_back(Extents(maxLevel, minX, minY, maxX, maxY)); _extentsList.push_back(Extents(maxLevel, minX, minY, maxX, maxY));
@@ -157,16 +154,16 @@ public:
void apply(osg::CoordinateSystemNode& cs) void apply(osg::CoordinateSystemNode& cs)
{ {
_csnStack.push_back(&cs); _csnStack.push_back(&cs);
if (!s_ExitApplication) traverse(cs); if (!s_ExitApplication) traverse(cs);
_csnStack.pop_back(); _csnStack.pop_back();
} }
void apply(osg::Group& group) void apply(osg::Group& group)
{ {
if (s_ExitApplication) return; if (s_ExitApplication) return;
osgTerrain::TerrainTile* terrainTile = dynamic_cast<osgTerrain::TerrainTile*>(&group); osgTerrain::TerrainTile* terrainTile = dynamic_cast<osgTerrain::TerrainTile*>(&group);
osgTerrain::Locator* locator = terrainTile ? terrainTile->getLocator() : 0; osgTerrain::Locator* locator = terrainTile ? terrainTile->getLocator() : 0;
if (locator) if (locator)
@@ -199,7 +196,7 @@ public:
return; return;
} }
traverse(group); traverse(group);
} }
@@ -220,11 +217,11 @@ public:
void apply(osg::PagedLOD& plod) void apply(osg::PagedLOD& plod)
{ {
if (s_ExitApplication) return; if (s_ExitApplication) return;
++_currentLevel; ++_currentLevel;
initBound(); initBound();
// first compute the bounds of this subgraph // first compute the bounds of this subgraph
for(unsigned int i=0; i<plod.getNumFileNames(); ++i) for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
{ {
@@ -233,7 +230,7 @@ public:
traverse(plod); traverse(plod);
} }
} }
if (intersects()) if (intersects())
{ {
for(unsigned int i=0; i<plod.getNumFileNames(); ++i) for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
@@ -242,7 +239,7 @@ public:
if (!plod.getFileName(i).empty()) if (!plod.getFileName(i).empty())
{ {
std::string filename; std::string filename;
if (!plod.getDatabasePath().empty()) if (!plod.getDatabasePath().empty())
{ {
filename = plod.getDatabasePath() + plod.getFileName(i); filename = plod.getDatabasePath() + plod.getFileName(i);
} }
@@ -258,10 +255,10 @@ public:
} }
} }
} }
--_currentLevel; --_currentLevel;
} }
void apply(osg::Geode& geode) void apply(osg::Geode& geode)
{ {
for(unsigned int i=0; i<geode.getNumDrawables(); ++i) for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
@@ -274,10 +271,10 @@ public:
} }
} }
} }
osg::ref_ptr<osg::Node> readNodeFileAndWriteToCache(const std::string& filename) osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
{ {
osg::ref_ptr<osg::Node> node = 0; osg::Node* node = 0;
if (_fileCache.valid() ) if (_fileCache.valid() )
{ {
if (_fileCache->existsInCache(filename)) if (_fileCache->existsInCache(filename))
@@ -289,7 +286,7 @@ public:
{ {
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readRefNodeFile(filename); node = osgDB::readNodeFile(filename);
if (node) if (node)
{ {
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
@@ -301,7 +298,7 @@ public:
else else
{ {
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readRefNodeFile(filename); node = osgDB::readNodeFile(filename);
} }
return node; return node;
} }
@@ -310,18 +307,18 @@ public:
protected: protected:
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); } inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
inline void popMatrix() { _matrixStack.pop_back(); } inline void popMatrix() { _matrixStack.pop_back(); }
void convertXYZToLatLongHeight(osg::EllipsoidModel* em, osg::Vec3d& v) void convertXYZToLatLongHeight(osg::EllipsoidModel* em, osg::Vec3d& v)
{ {
em->convertXYZToLatLongHeight(v.x(), v.y(), v.z(), em->convertXYZToLatLongHeight(v.x(), v.y(), v.z(),
v.y(), v.x(), v.z()); v.y(), v.x(), v.z());
v.x() = osg::RadiansToDegrees(v.x()); v.x() = osg::RadiansToDegrees(v.x());
v.y() = osg::RadiansToDegrees(v.y()); v.y() = osg::RadiansToDegrees(v.y());
} }
void initBound() void initBound()
{ {
_min.set(DBL_MAX, DBL_MAX); _min.set(DBL_MAX, DBL_MAX);
@@ -335,16 +332,16 @@ protected:
if (v.x() > _max.x()) _max.x() = v.x(); if (v.x() > _max.x()) _max.x() = v.x();
if (v.y() > _max.y()) _max.y() = v.y(); if (v.y() > _max.y()) _max.y() = v.y();
} }
void updateBound(osg::Vec3Array& vertices) void updateBound(osg::Vec3Array& vertices)
{ {
// set up matrix // set up matrix
osg::Matrix matrix; osg::Matrix matrix;
if (!_matrixStack.empty()) matrix = _matrixStack.back(); if (!_matrixStack.empty()) matrix = _matrixStack.back();
// set up ellipsoid model // set up ellipsoid model
osg::EllipsoidModel* em = !_csnStack.empty() ? _csnStack.back()->getEllipsoidModel() : 0; osg::EllipsoidModel* em = !_csnStack.empty() ? _csnStack.back()->getEllipsoidModel() : 0;
for(osg::Vec3Array::iterator itr = vertices.begin(); for(osg::Vec3Array::iterator itr = vertices.begin();
itr != vertices.end(); itr != vertices.end();
++itr) ++itr)
@@ -355,7 +352,7 @@ protected:
updateBound(v); updateBound(v);
} }
} }
bool intersects() bool intersects()
{ {
osg::notify(osg::INFO)<<"intersects() _min = "<<_min<<" _max = "<<_max<<std::endl; osg::notify(osg::INFO)<<"intersects() _min = "<<_min<<" _max = "<<_max<<std::endl;
@@ -365,7 +362,7 @@ protected:
{ {
if (itr->intersects(_currentLevel, _min, _max)) return true; if (itr->intersects(_currentLevel, _min, _max)) return true;
} }
return false; return false;
} }
@@ -379,15 +376,15 @@ protected:
unsigned int _currentLevel; unsigned int _currentLevel;
MatrixStack _matrixStack; MatrixStack _matrixStack;
CSNStack _csnStack; CSNStack _csnStack;
osg::Vec2d _min; osg::Vec2d _min;
osg::Vec2d _max; osg::Vec2d _max;
}; };
static void signalHandler(int sig) static void signalHandler(int sig)
{ {
s_SigValue.exchange(sig); printf("\nCaught signal %d, requesting exit...\n\n",sig);
s_ExitApplication.exchange(1); s_ExitApplication = true;
} }
int main( int argc, char **argv ) int main( int argc, char **argv )
@@ -406,7 +403,7 @@ int main( int argc, char **argv )
// use an ArgumentParser object to manage the program arguments. // use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program. // set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications.."); arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
@@ -415,21 +412,21 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively."); arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively.");
arguments.getApplicationUsage()->addCommandLineOption("-c directory","Shorthand for --file-cache directory."); arguments.getApplicationUsage()->addCommandLineOption("-c directory","Shorthand for --file-cache directory.");
arguments.getApplicationUsage()->addCommandLineOption("--file-cache directory","Set directory as to place cache download files."); arguments.getApplicationUsage()->addCommandLineOption("--file-cache directory","Set directory as to place cache download files.");
// if user request help write it out to cout. // if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help")) if (arguments.read("-h") || arguments.read("--help"))
{ {
arguments.getApplicationUsage()->write(std::cout); arguments.getApplicationUsage()->write(std::cout);
return 1; return 1;
} }
LoadDataVisitor ldv; LoadDataVisitor ldv;
std::string fileCachePath; std::string fileCachePath;
while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {} while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {}
if (fileCachePath.empty()) if (fileCachePath.empty())
{ {
const char* env_fileCachePath = getenv("OSG_FILE_CACHE"); const char* env_fileCachePath = getenv("OSG_FILE_CACHE");
if (env_fileCachePath) if (env_fileCachePath)
{ {
@@ -442,7 +439,7 @@ int main( int argc, char **argv )
std::cout<<"No path to the file cache defined, please set OSG_FILE_PATH env var, or use --file-cache <directory> to set a suitable directory for the file cache."<<std::endl; std::cout<<"No path to the file cache defined, please set OSG_FILE_PATH env var, or use --file-cache <directory> to set a suitable directory for the file cache."<<std::endl;
return 1; return 1;
} }
ldv.setFileCache(new osgDB::FileCache(fileCachePath)); ldv.setFileCache(new osgDB::FileCache(fileCachePath));
unsigned int maxLevels = 0; unsigned int maxLevels = 0;
@@ -450,14 +447,14 @@ int main( int argc, char **argv )
{ {
ldv.addExtents(maxLevels); ldv.addExtents(maxLevels);
} }
double minX, maxX, minY, maxY; double minX, maxX, minY, maxY;
while(arguments.read("-e",maxLevels, minX, minY, maxX, maxY)) while(arguments.read("-e",maxLevels, minX, minY, maxX, maxY))
{ {
ldv.addExtents(maxLevels, minX, minY, maxX, maxY); ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
} }
std::string filename; std::string filename;
for(int i=1; i<arguments.argc(); ++i) for(int i=1; i<arguments.argc(); ++i)
{ {
@@ -467,26 +464,26 @@ int main( int argc, char **argv )
break; break;
} }
} }
if (filename.empty()) if (filename.empty())
{ {
std::cout<<"No file to load specified."<<std::endl; std::cout<<"No file to load specified."<<std::endl;
return 1; return 1;
} }
osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename); osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename);
if (!loadedModel) if (!loadedModel)
{ {
std::cout<<"No data loaded, please specify a database to load"<<std::endl; std::cout<<"No data loaded, please specify a database to load"<<std::endl;
return 1; return 1;
} }
loadedModel->accept(ldv); loadedModel->accept(ldv);
if (s_ExitApplication) if (s_ExitApplication)
{ {
std::cout<<"osgfilecache exited in response to signal : "<<s_SigValue<<std::endl; std::cout<<"osgfilecache cleanly exited in response to signal."<<std::endl;
} }
return 0; return 0;

View File

@@ -254,37 +254,7 @@ const char* invalidNames[] =
"GraphicsContext*", "GraphicsContext*",
"Apple", "Apple",
"GeometryNew", "GeometryNew",
"FrameBufferObject", "FrameBufferObject"
"Lua",
"VolumeTile",
"PushStackValueVisitor",
"RayIntersector",
"OpenSceneGraph-Data",
"Node",
"AlphaFunc",
"CompositeViewer",
"OpenSceneGraph-3",
"DisplaySettings::SHADER_NONE",
"CodeDocs",
"Mon",
"Tue",
"Wed",
"Fri",
"Sat",
"Sun",
"I",
"TriangleFunctor",
"PrimitiveFunctor",
"OpenMW",
"StreamOperator",
"SceneLoader",
"OpenGL",
"FindLIBLAS",
"PissedCapslock",
"MinGW",
"Haojia521",
"Github",
"It"
}; };
@@ -377,7 +347,6 @@ TypoCorrection typoCorrections[] =
{"Krulthof", "Kruithof"}, {"Krulthof", "Kruithof"},
{"Lagrade", "Lagarde"}, {"Lagrade", "Lagarde"},
{"Largade", "Lagarde"}, {"Largade", "Lagarde"},
{"Largarde", "Lagarde"},
{"Larshkari", "Lashkari"}, {"Larshkari", "Lashkari"},
{"Lashakari", "Lashkari"}, {"Lashakari", "Lashkari"},
{"Lashari", "Lashkari"}, {"Lashari", "Lashkari"},
@@ -485,31 +454,7 @@ TypoCorrection typoCorrections[] =
{"Eskland","Ekstrand"}, {"Eskland","Ekstrand"},
{"Baeuerele","Baeuerle"}, {"Baeuerele","Baeuerle"},
{"Bauerle","Baeuerle"}, {"Bauerle","Baeuerle"},
{"Baeurele","Baeuerle"}, {"Baeurele","Baeuerle"}
{"Nillson","Nilsson"},
{"Bjorn","Bj<EFBFBD>rn"},
{"Björn","Bj<EFBFBD>rn"},
{"Stepan","Stephan"},
{"Kristoger","Kristofer"},
{"Blessing","Blissing"},
{"Dannahuer","Dannhauer"},
{"Chebeav", "Chebaev"},
{"Messershmidt","Messerschmidt"},
{"Auelien","Aurelien"},
{"Aurélien","Aur<EFBFBD>lien"},
{"McDonnel","Mc Donnell"},
{"McDonnell","Mc Donnell"},
{"Delallée","Delall<EFBFBD>e"},
{"Gjøl","Gj<EFBFBD>l"},
{"Ravšelj","Rav<EFBFBD>elj"},
{"Ravsel", "Rav<EFBFBD>elj"},
{"Ravselj", "Rav<EFBFBD>elj"},
{"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"},
{"Vigano", "Vigan<EFBFBD>"},
{"Frashud", "Farshid"},
{"Dannahauer","Dannahauer"},
{"Sando","Sandro"}
}; };
@@ -523,18 +468,6 @@ struct NameCorrection
NameCorrection nameCorrections[] = NameCorrection nameCorrections[] =
{ {
{"LaurensVoerman","GetScalarValue",
"Laurens", "Voerman"},
{"LaurensVoerman","Meta_Shape",
"Laurens", "Voerman"},
{"LaurensVoerman","OpenCascade",
"Laurens", "Voerman"},
{"LaurensVoerman","Fri",
"Laurens", "Voerman"},
{"LaurensVoerman","",
"Laurens", "Voerman"},
{"Laurens","Loerman",
"Laurens", "Voerman"},
{"FrancoisTigeot","", {"FrancoisTigeot","",
"Francois", "Tigeot"}, "Francois", "Tigeot"},
{"Juan","Manuel", {"Juan","Manuel",
@@ -629,8 +562,6 @@ NameCorrection nameCorrections[] =
"Melchior", "Franz"}, "Melchior", "Franz"},
{"Glen", "Waldon", {"Glen", "Waldon",
"Glenn", "Waldron"}, "Glenn", "Waldron"},
{"Glen", "Waldron",
"Glenn", "Waldron"},
{"Ralf", "Karn", {"Ralf", "Karn",
"Ralf", "Kern"}, "Ralf", "Kern"},
{"Donny", "Cipperly", {"Donny", "Cipperly",
@@ -663,8 +594,6 @@ NameCorrection nameCorrections[] =
"Romano", "Jos<EFBFBD> Magacho da Silva"}, "Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Rommano", "Silva", {"Rommano", "Silva",
"Romano", "Jos<EFBFBD> Magacho da Silva"}, "Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Romano", "Magacho",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Leandro", "Motta", {"Leandro", "Motta",
"Leandro", "Motta Barros"}, "Leandro", "Motta Barros"},
{"Leandro", "Motto", {"Leandro", "Motto",
@@ -690,29 +619,7 @@ NameCorrection nameCorrections[] =
{"Tyge", "", {"Tyge", "",
"Tyge", "L<EFBFBD>vset"}, "Tyge", "L<EFBFBD>vset"},
{"Ricard", "Schmidt", {"Ricard", "Schmidt",
"Richard", "Schmidt"}, "Richard", "Schmidt"}
{"Matthias", "Helsing",
"Mattias", "Helsing"},
{"Clement", "Boesch",
"Cl<EFBFBD>ment", "B<EFBFBD>sch"},
{"Lauren", "Voerman",
"Laurens", "Voerman"},
{"Pjotr", "Sventachov",
"Pjotr", "Svetachov"},
{"Bradley", "Baker",
"Bradley", "Baker Searles"},
{"PawelKsiezopolski", "",
"Pawel", "Ksiezopolski"},
{"Albert", "Luaces",
"Alberto","Luaces"},
{"KOS", "",
"Konstantin","Matveyev"},
{"WeSee", "",
"Alois", "Wismer"},
{"We", "See",
"Alois", "Wismer"},
{"AnyOldName3", "",
"Chris", "Djali"}
}; };
@@ -1044,9 +951,7 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-------------------------" << endl; cout << "-------------------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr) for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{ {
cout << sitr->first << "\t" << sitr->second.first; cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
} }
} }
else else
@@ -1055,9 +960,7 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-----------------" << endl; cout << "-----------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr) for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{ {
cout << sitr->second.first; cout << sitr->second.first << " " << sitr->second.second << endl;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
} }
} }
} }

View File

@@ -1,5 +1,5 @@
// The majority of the application is dedicated to building the // The majority of the application is dedicated to building the
// current contributors list by parsing the ChangeLog, it just takes // current contribitors list by parsing the ChangeLog, it just takes
// one line in the main itself to report the version number. // one line in the main itself to report the version number.
#include <set> #include <set>

View File

@@ -14,7 +14,6 @@
#include <osg/CoordinateSystemNode> #include <osg/CoordinateSystemNode>
#include <osg/Switch> #include <osg/Switch>
#include <osg/Types>
#include <osgText/Text> #include <osgText/Text>
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
@@ -33,6 +32,111 @@
#include <iostream> #include <iostream>
#include <osg/GLExtensions>
#ifndef GL_ARB_sync
#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
#define GL_OBJECT_TYPE 0x9112
#define GL_SYNC_CONDITION 0x9113
#define GL_SYNC_STATUS 0x9114
#define GL_SYNC_FLAGS 0x9115
#define GL_SYNC_FENCE 0x9116
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#define GL_UNSIGNALED 0x9118
#define GL_SIGNALED 0x9119
#define GL_ALREADY_SIGNALED 0x911A
#define GL_TIMEOUT_EXPIRED 0x911B
#define GL_CONDITION_SATISFIED 0x911C
#define GL_WAIT_FAILED 0x911D
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
#endif
class MySwapBuffersCallback : public osg::GraphicsContext::SwapCallback
{
public:
MySwapBuffersCallback():
_extensionInitialized(false),
_glFenceSync(0),
_glIsSync(0),
_glDeleteSync(0),
_glClientWaitSync(0),
_glWaitSync(0),
_glGetInteger64v(0),
_glGetSynciv(0),
_previousSync(0)
{
OSG_NOTICE<<"Created Swap callback."<<std::endl;
}
void setUpExtensions()
{
_extensionInitialized = true;
osg::setGLExtensionFuncPtr(_glFenceSync, "glFenceSync");
osg::setGLExtensionFuncPtr(_glIsSync, "glIsSync");
osg::setGLExtensionFuncPtr(_glDeleteSync, "glDeleteSync");
osg::setGLExtensionFuncPtr(_glClientWaitSync, "glClientWaitSync");
osg::setGLExtensionFuncPtr(_glWaitSync, "glWaitSync");
osg::setGLExtensionFuncPtr(_glGetInteger64v, "glGetInteger64v");
osg::setGLExtensionFuncPtr(_glGetSynciv, "glGetSynciv");
}
virtual void swapBuffersImplementation(osg::GraphicsContext* gc)
{
// OSG_NOTICE<<"Before swap - place to do swap ready sync"<<std::endl;
gc->swapBuffersImplementation();
//glFinish();
if (!_extensionInitialized) setUpExtensions();
if (_glClientWaitSync)
{
if (_previousSync)
{
unsigned int num_seconds = 1;
GLuint64 timeout = num_seconds * ((GLuint64)1000 * 1000 * 1000);
_glClientWaitSync(_previousSync, 0, timeout);
_glDeleteSync(_previousSync);
}
_previousSync = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
}
//gc->getState()->checkGLErrors("after glWaitSync");
//OSG_NOTICE<<"After swap"<<std::endl;
}
#ifdef _WIN32
typedef __int64 GLint64;
typedef unsigned __int64 GLuint64;
#else
typedef int64_t GLint64;
typedef uint64_t GLuint64;
#endif
typedef struct __GLsync *GLsync;
typedef GLsync (GL_APIENTRY * PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
typedef GLboolean (GL_APIENTRY * PFNGLISSYNCPROC) (GLsync sync);
typedef void (GL_APIENTRY * PFNGLDELETESYNCPROC) (GLsync sync);
typedef GLenum (GL_APIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRY * PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
typedef void (GL_APIENTRY * PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
bool _extensionInitialized;
PFNGLFENCESYNCPROC _glFenceSync;
PFNGLISSYNCPROC _glIsSync;
PFNGLDELETESYNCPROC _glDeleteSync;
PFNGLCLIENTWAITSYNCPROC _glClientWaitSync;
PFNGLWAITSYNCPROC _glWaitSync;
PFNGLGETINTEGER64VPROC _glGetInteger64v;
PFNGLGETSYNCIVPROC _glGetSynciv;
GLsync _previousSync;
};
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
@@ -74,19 +178,23 @@ int main(int argc, char** argv)
std::string url, username, password; std::string url, username, password;
while(arguments.read("--login",url, username, password)) while(arguments.read("--login",url, username, password))
{ {
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails( if (!osgDB::Registry::instance()->getAuthenticationMap())
url, {
new osgDB::AuthenticationDetails(username, password) osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
); osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
} }
std::string device; std::string device;
while(arguments.read("--device", device)) while(arguments.read("--device", device))
{ {
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device); osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device);
if (dev.valid()) if (dev.valid())
{ {
viewer.addDevice(dev); viewer.addDevice(dev.get());
} }
} }
@@ -123,6 +231,8 @@ int main(int argc, char** argv)
viewer.setCameraManipulator( keyswitchManipulator.get() ); viewer.setCameraManipulator( keyswitchManipulator.get() );
} }
bool doArbSync = arguments.read("--sync");
// add the state manipulator // add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
@@ -148,7 +258,7 @@ int main(int argc, char** argv)
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data // load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel) if (!loadedModel)
{ {
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
@@ -168,12 +278,24 @@ int main(int argc, char** argv)
// optimize the scene graph, remove redundant nodes and state etc. // optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel); optimizer.optimize(loadedModel.get());
viewer.setSceneData(loadedModel); viewer.setSceneData( loadedModel.get() );
viewer.realize(); viewer.realize();
if (doArbSync)
{
osgViewer::ViewerBase::Contexts contexts;
viewer.getContexts(contexts);
for(osgViewer::ViewerBase::Contexts::iterator itr = contexts.begin();
itr != contexts.end();
++itr)
{
(*itr)->setSwapCallback(new MySwapBuffersCallback);
}
}
return viewer.run(); return viewer.run();
} }

View File

@@ -54,7 +54,7 @@ IF (NOT DYNAMIC_OPENSCENEGRAPH)
osgdb_openflight osgdb_openflight
osgdb_obj osgdb_obj
) )
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation
osgdb_deprecated_osgfx osgdb_deprecated_osgsim osgdb_deprecated_osgtext osgdb_deprecated_osgfx osgdb_deprecated_osgsim osgdb_deprecated_osgtext

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include "Cluster.h" #include "Cluster.h"
@@ -16,7 +15,6 @@
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>
#include <errno.h>
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -35,17 +33,15 @@
#if defined(__linux) #if defined(__linux)
#include <unistd.h> #include <unistd.h>
#include <linux/sockios.h> #include <linux/sockios.h>
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined(__DragonFly__)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#elif defined(__sgi) #elif defined(__sgi)
#include <unistd.h> #include <unistd.h>
#include <net/soioctl.h> #include <net/soioctl.h>
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
#include <unistd.h> #include <unistd.h>
#elif defined (__GNU__) #elif defined(__sun)
#include <unistd.h>
#elif defined(__sun)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#elif defined (__APPLE__) #elif defined (__APPLE__)
@@ -206,8 +202,7 @@ void DataConverter::write(CameraPacket& cameraPacket)
itr != cameraPacket._events.end(); itr != cameraPacket._events.end();
++itr) ++itr)
{ {
osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter(); write(*(*itr));
if (event) write(*(event));
} }
} }
@@ -254,7 +249,7 @@ void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// Receiver // Reciever
// //
Receiver::Receiver( void ) Receiver::Receiver( void )
{ {
@@ -292,23 +287,14 @@ bool Receiver::init( void )
perror( "Socket" ); perror( "Socket" );
return false; return false;
} }
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE; // const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else #else
int on = 1; int on = 1;
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif #endif
if (result)
{
OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="<<errno<<std::endl;
return false;
}
// struct sockaddr_in saddr; // struct sockaddr_in saddr;
saddr.sin_family = AF_INET; saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
@@ -351,8 +337,8 @@ void Receiver::sync( void )
} }
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \ #if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(__GNU__) defined(__DragonFly__)
socklen_t socklen_t
#else #else
int int
#endif #endif
@@ -368,17 +354,11 @@ void Receiver::sync( void )
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port ); // saddr.sin_port = htons( _port );
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
//int err = WSAGetLastError (); //int err = WSAGetLastError ();
//int *dum = (int*) _buffer; //int *dum = (int*) _buffer;
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
while( select( _so+1, &fdset, 0L, 0L, &tv ) ) while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{ {
if( FD_ISSET( _so, &fdset ) ) if( FD_ISSET( _so, &fdset ) )
@@ -387,13 +367,7 @@ void Receiver::sync( void )
} }
} }
#else #else
int result = recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size ); recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size );
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
while( select( _so+1, &fdset, 0L, 0L, &tv ) ) while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{ {
if( FD_ISSET( _so, &fdset ) ) if( FD_ISSET( _so, &fdset ) )
@@ -407,7 +381,7 @@ void Receiver::sync( void )
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// Broadcaster // Broadcaster
// //
Broadcaster::Broadcaster( void ) Broadcaster::Broadcaster( void )
{ {
@@ -452,26 +426,21 @@ bool Broadcaster::init( void )
int on = 1; int on = 1;
#endif #endif
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int)); setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else #else
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif #endif
if (result) return false;
saddr.sin_family = AF_INET; saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
if( _address == 0 ) if( _address == 0 )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int)); setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else #else
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif #endif
if (result) return false;
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (WIN32) || defined(__CYGWIN__)
struct ifreq ifr; struct ifreq ifr;
@@ -542,19 +511,14 @@ void Broadcaster::sync( void )
return; return;
} }
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN ); unsigned int size = sizeof( SOCKADDR_IN );
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
// int err = WSAGetLastError (); // int err = WSAGetLastError ();
// int *dum = (int*) _buffer; // int *dum = (int*) _buffer;
#else #else
unsigned int size = sizeof( struct sockaddr_in ); unsigned int size = sizeof( struct sockaddr_in );
result = sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
#endif #endif
if (result)
{
OSG_NOTICE<<"Warning: sentTo(...) failed : errno="<<errno<<std::endl;
}
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef CLUSTER_H #ifndef CLUSTER_H
@@ -30,25 +29,25 @@
// //
// Class definition for the recipient of a broadcasted message // Class definition for the recipient of a broadcasted message
// //
class Receiver class Receiver
{ {
public : public :
Receiver(); Receiver();
~Receiver(); ~Receiver();
// setBuffer defines the buffer into which the broadcasted // setBuffer defines the buffer into which the broadcasted
// message will be received. // message will be received.
void setBuffer( void *buffer, const unsigned int size ); void setBuffer( void *buffer, const unsigned int size );
// Define what port to listen and bind to // Define what port to listen and bind to
void setPort( const short port ); void setPort( const short port );
// Sync does a blocking wait to receive next message // Sync does a blocking wait to recieve next message
void sync( void ); void sync( void );
private : private :
bool init( void ); bool init( void );
private : private :
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (WIN32) && !defined(__CYGWIN__)
@@ -69,29 +68,29 @@ class Receiver
// //
// Class definition for broadcasting a buffer to a LAN // Class definition for broadcasting a buffer to a LAN
// //
class Broadcaster class Broadcaster
{ {
public : public :
Broadcaster( void ); Broadcaster( void );
~Broadcaster( void ); ~Broadcaster( void );
// Set the broadcast port // Set the broadcast port
void setPort( const short port ); void setPort( const short port );
// Set the buffer to be broadcast // Set the buffer to be broadcast
void setBuffer( void *buffer, const unsigned int buffer_size ); void setBuffer( void *buffer, const unsigned int buffer_size );
// Set a recipient host. If this is used, the Broadcaster // Set a recipient host. If this is used, the Broadcaster
// no longer broadcasts, but rather directs UDP packets at // no longer broadcasts, but rather directs UDP packets at
// host. // host.
void setHost( const char *hostname ); void setHost( const char *hostname );
// Sync broadcasts the buffer // Sync broadcasts the buffer
void sync( void ); void sync( void );
private : private :
bool init( void ); bool init( void );
private : private :
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
@@ -113,15 +112,15 @@ class Broadcaster
class CameraPacket { class CameraPacket {
public: public:
static const unsigned int MAX_NUM_EVENTS; static const unsigned int MAX_NUM_EVENTS;
static const unsigned int SWAP_BYTES_COMPARE; static const unsigned int SWAP_BYTES_COMPARE;
CameraPacket():_masterKilled(false) CameraPacket():_masterKilled(false)
{ {
_byte_order = SWAP_BYTES_COMPARE; _byte_order = SWAP_BYTES_COMPARE;
} }
void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp)
{ {
_matrix = matrix; _matrix = matrix;
@@ -130,20 +129,20 @@ class CameraPacket {
_frameStamp = *frameStamp; _frameStamp = *frameStamp;
} }
} }
void getModelView(osg::Matrix& matrix,float angle_offset=0.0f) void getModelView(osg::Matrix& matrix,float angle_offset=0.0f)
{ {
matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f);
} }
void readEventQueue(osgViewer::Viewer& viewer); void readEventQueue(osgViewer::Viewer& viewer);
void writeEventQueue(osgViewer::Viewer& viewer); void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; } void setMasterKilled(const bool flag) { _masterKilled = flag; }
bool getMasterKilled() const { return _masterKilled; } const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order; unsigned int _byte_order;
bool _masterKilled; bool _masterKilled;
osg::Matrix _matrix; osg::Matrix _matrix;
@@ -151,11 +150,11 @@ class CameraPacket {
// note don't use a ref_ptr as used elsewhere for FrameStamp // note don't use a ref_ptr as used elsewhere for FrameStamp
// since we don't want to copy the pointer - but the memory. // since we don't want to copy the pointer - but the memory.
// FrameStamp doesn't have a private destructor to allow // FrameStamp doesn't have a private destructor to allow
// us to do this, even though its a reference counted object. // us to do this, even though its a reference counted object.
osg::FrameStamp _frameStamp; osg::FrameStamp _frameStamp;
osgGA::EventQueue::Events _events; osgGA::EventQueue::Events _events;
}; };
class DataConverter class DataConverter
@@ -187,22 +186,22 @@ class DataConverter
{ {
if (_currentPtr+1>=_endPtr) return; if (_currentPtr+1>=_endPtr) return;
*(_currentPtr++) = *(ptr); *(_currentPtr++) = *(ptr);
} }
inline void read1(char* ptr) inline void read1(char* ptr)
{ {
if (_currentPtr+1>=_endPtr) return; if (_currentPtr+1>=_endPtr) return;
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
inline void write2(char* ptr) inline void write2(char* ptr)
{ {
if (_currentPtr+2>=_endPtr) return; if (_currentPtr+2>=_endPtr) return;
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr); *(_currentPtr++) = *(ptr);
} }
inline void read2(char* ptr) inline void read2(char* ptr)
@@ -211,13 +210,13 @@ class DataConverter
if (_swapBytes) if (_swapBytes)
{ {
*(ptr+1) = *(_currentPtr++); *(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
else else
{ {
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
} }
@@ -225,10 +224,10 @@ class DataConverter
{ {
if (_currentPtr+4>=_endPtr) return; if (_currentPtr+4>=_endPtr) return;
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr); *(_currentPtr++) = *(ptr);
} }
inline void read4(char* ptr) inline void read4(char* ptr)
@@ -237,17 +236,17 @@ class DataConverter
if (_swapBytes) if (_swapBytes)
{ {
*(ptr+3) = *(_currentPtr++); *(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++); *(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++); *(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
else else
{ {
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
} }
@@ -255,15 +254,15 @@ class DataConverter
{ {
if (_currentPtr+8>=_endPtr) return; if (_currentPtr+8>=_endPtr) return;
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++); *(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr); *(_currentPtr++) = *(ptr);
} }
inline void read8(char* ptr) inline void read8(char* ptr)
@@ -273,27 +272,27 @@ class DataConverter
if (_swapBytes) if (_swapBytes)
{ {
*(ptr+7) = *(_currentPtr++); *(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++); *(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++); *(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++); *(ptr+4) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++); *(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++); *(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++); *(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
else else
{ {
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++); *(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++); *(ptr) = *(_currentPtr++);
} }
} }
@@ -306,14 +305,14 @@ class DataConverter
inline void writeFloat(float c) { write4((char*)&c); } inline void writeFloat(float c) { write4((char*)&c); }
inline void writeDouble(double c) { write8((char*)&c); } inline void writeDouble(double c) { write8((char*)&c); }
inline char readChar() { char c=0; read1(&c); return c; } inline char readChar() { char c; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; } inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
inline short readShort() { short c=0; read2((char*)&c); return c; } inline short readShort() { short c; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; } inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
inline int readInt() { int c=0; read4((char*)&c); return c; } inline int readInt() { int c; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; } inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; } inline float readFloat() { float c; read4((char*)&c); return c; }
inline double readDouble() { double c=0.0; read8((char*)&c); return c; } inline double readDouble() { double c; read8((char*)&c); return c; }
void write(const osg::FrameStamp& fs); void write(const osg::FrameStamp& fs);
void read(osg::FrameStamp& fs); void read(osg::FrameStamp& fs);
@@ -323,13 +322,13 @@ class DataConverter
void write(const osgGA::GUIEventAdapter& event); void write(const osgGA::GUIEventAdapter& event);
void read(osgGA::GUIEventAdapter& event); void read(osgGA::GUIEventAdapter& event);
void write(CameraPacket& cameraPacket); void write(CameraPacket& cameraPacket);
void read(CameraPacket& cameraPacket); void read(CameraPacket& cameraPacket);
char* startPtr() { return _startPtr; } char* startPtr() { return _startPtr; }
unsigned int numBytes() { return _numBytes; } unsigned int numBytes() { return _numBytes; }
protected: protected:
char* _startPtr; char* _startPtr;
@@ -342,4 +341,4 @@ class DataConverter
#endif #endif

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include "ExportHTML.h" #include "ExportHTML.h"
@@ -47,16 +46,16 @@ public:
void setSnapImageOnNextFrame(bool flag) { _snapImageOnNextFrame = flag; } void setSnapImageOnNextFrame(bool flag) { _snapImageOnNextFrame = flag; }
bool getSnapImageOnNextFrame() const { return _snapImageOnNextFrame; } bool getSnapImageOnNextFrame() const { return _snapImageOnNextFrame; }
virtual void operator () (const osg::Camera& camera) const virtual void operator () (const osg::Camera& camera) const
{ {
if (!_snapImageOnNextFrame) return; if (!_snapImageOnNextFrame) return;
int x = static_cast<int>(camera.getViewport()->x()); int x = static_cast<int>(camera.getViewport()->x());
int y = static_cast<int>(camera.getViewport()->y()); int y = static_cast<int>(camera.getViewport()->y());
unsigned int width = static_cast<unsigned int>(camera.getViewport()->width()); unsigned int width = static_cast<unsigned int>(camera.getViewport()->width());
unsigned int height = static_cast<unsigned int>(camera.getViewport()->height()); unsigned int height = static_cast<unsigned int>(camera.getViewport()->height());
osg::ref_ptr<osg::Image> image = new osg::Image; osg::ref_ptr<osg::Image> image = new osg::Image;
image->readPixels(x,y,width,height, image->readPixels(x,y,width,height,
GL_RGB,GL_UNSIGNED_BYTE); GL_RGB,GL_UNSIGNED_BYTE);
@@ -65,16 +64,16 @@ public:
{ {
osg::notify(osg::NOTICE) << "Saved screen image to `"<<_filename<<"`"<< std::endl; osg::notify(osg::NOTICE) << "Saved screen image to `"<<_filename<<"`"<< std::endl;
} }
_snapImageOnNextFrame = false; _snapImageOnNextFrame = false;
} }
protected: protected:
std::string _filename; std::string _filename;
mutable bool _snapImageOnNextFrame; mutable bool _snapImageOnNextFrame;
}; };
std::string ExportHTML::createFileName(const std::string& basename, unsigned int page, const std::string& ext) std::string ExportHTML::createFileName(const std::string& basename, unsigned int page, const std::string& ext)
@@ -103,7 +102,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
image_basename = osgDB::getNameLessExtension(filename); image_basename = osgDB::getNameLessExtension(filename);
image_ext = ".jpg"; image_ext = ".jpg";
} }
std::cout<<"Writing slides to "<<image_basename<<"_[slidenumber]"<<image_ext<<std::endl; std::cout<<"Writing slides to "<<image_basename<<"_[slidenumber]"<<image_ext<<std::endl;
osg::ref_ptr<SnapImageDrawCallback> sidc = new SnapImageDrawCallback; osg::ref_ptr<SnapImageDrawCallback> sidc = new SnapImageDrawCallback;
@@ -170,7 +169,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
} }
fout<<"</tr>"<<std::endl; fout<<"</tr>"<<std::endl;
fout<<"</table>"<<std::endl; fout<<"</table>"<<std::endl;
fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl; fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl;
fout<<"</html>"<<std::endl; fout<<"</html>"<<std::endl;
} }
else else

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef EXPORTHTML_H #ifndef EXPORTHTML_H

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include "PointsEventHandler.h" #include "PointsEventHandler.h"
@@ -55,6 +54,11 @@ bool PointsEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
return false; return false;
} }
void PointsEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
{
v.visit(*this);
}
void PointsEventHandler::getUsage(osg::ApplicationUsage& usage) const void PointsEventHandler::getUsage(osg::ApplicationUsage& usage) const
{ {
usage.addKeyboardMouseBinding("+","Increase point size"); usage.addKeyboardMouseBinding("+","Increase point size");

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef POINTSEVENTHANDLER #ifndef POINTSEVENTHANDLER
@@ -23,23 +22,25 @@ class PointsEventHandler : public osgGA::GUIEventHandler
{ {
public: public:
PointsEventHandler(); PointsEventHandler();
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&); virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
void getUsage(osg::ApplicationUsage& usage) const; void getUsage(osg::ApplicationUsage& usage) const;
void setStateSet(osg::StateSet* stateset) { _stateset=stateset; } void setStateSet(osg::StateSet* stateset) { _stateset=stateset; }
osg::StateSet* getStateSet() { return _stateset.get(); } osg::StateSet* getStateSet() { return _stateset.get(); }
const osg::StateSet* getStateSet() const { return _stateset.get(); } const osg::StateSet* getStateSet() const { return _stateset.get(); }
void setPointSize(float psize); void setPointSize(float psize);
float getPointSize() const; float getPointSize() const;
void changePointSize(float delta); void changePointSize(float delta);
void changePointAttenuation(float scale); void changePointAttenuation(float scale);
osg::ref_ptr<osg::StateSet> _stateset; osg::ref_ptr<osg::StateSet> _stateset;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include "ReadShowFile.h" #include "ReadShowFile.h"
@@ -36,7 +35,7 @@ class AddVolumeEditingCallbackVisitor : public osg::NodeVisitor
public: public:
AddVolumeEditingCallbackVisitor(): AddVolumeEditingCallbackVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
void apply(osg::Group& group) void apply(osg::Group& group)
{ {
osgVolume::VolumeTile* volumeTile = dynamic_cast<osgVolume::VolumeTile*>(&group); osgVolume::VolumeTile* volumeTile = dynamic_cast<osgVolume::VolumeTile*>(&group);
@@ -52,7 +51,7 @@ public:
traverse(group); traverse(group);
} }
} }
}; };
bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, FileNameList& normalFiles) bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, FileNameList& normalFiles)
@@ -63,7 +62,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F
if (!arguments.isOption(pos)) if (!arguments.isOption(pos))
{ {
std::string ext = osgDB::getFileExtension(arguments[pos]); std::string ext = osgDB::getFileExtension(arguments[pos]);
if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d")) if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d"))
{ {
xmlFiles.push_back(arguments[pos]); xmlFiles.push_back(arguments[pos]);
} }
@@ -74,7 +73,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F
} }
} }
return (!xmlFiles.empty() || !normalFiles.empty()); return (!xmlFiles.empty() || !normalFiles.empty());
} }
bool p3d::readEnvVars(osg::ArgumentParser& arguments) bool p3d::readEnvVars(osg::ArgumentParser& arguments)
{ {
@@ -95,23 +94,23 @@ bool p3d::readEnvVars(osg::ArgumentParser& arguments)
{ {
osgDB::getDataFilePathList().push_front(path); osgDB::getDataFilePathList().push_front(path);
} }
if (p3d::readEnvVars(file)) readVars = true; if (p3d::readEnvVars(file)) readVars = true;
} }
} }
} }
} }
return readVars; return readVars;
} }
bool p3d::readEnvVars(const std::string& fileName) bool p3d::readEnvVars(const std::string& fileName)
{ {
std::string ext = osgDB::getFileExtension(fileName); std::string ext = osgDB::getFileExtension(fileName);
if (!osgDB::equalCaseInsensitive(ext,"xml") && if (!osgDB::equalCaseInsensitive(ext,"xml") &&
!osgDB::equalCaseInsensitive(ext,"p3d")) return false; !osgDB::equalCaseInsensitive(ext,"p3d")) return false;
osg::ref_ptr<osgDB::XmlNode> doc = new osgDB::XmlNode; osg::ref_ptr<osgDB::XmlNode> doc = new osgDB::XmlNode;
osgDB::XmlNode* root = 0; osgDB::XmlNode* root = 0;
@@ -147,7 +146,7 @@ bool p3d::readEnvVars(const std::string& fileName)
} }
bool readVars = false; bool readVars = false;
for(osgDB::XmlNode::Children::iterator itr = root->children.begin(); for(osgDB::XmlNode::Children::iterator itr = root->children.begin();
itr != root->children.end(); itr != root->children.end();
++itr) ++itr)
@@ -183,7 +182,7 @@ osgDB::Options* createOptions(const osgDB::ReaderWriter::Options* options)
osg::ref_ptr<osg::Node> p3d::readHoldingSlide(const std::string& filename) osg::ref_ptr<osg::Node> p3d::readHoldingSlide(const std::string& filename)
{ {
std::string ext = osgDB::getFileExtension(filename); std::string ext = osgDB::getFileExtension(filename);
if (!osgDB::equalCaseInsensitive(ext,"xml") && if (!osgDB::equalCaseInsensitive(ext,"xml") &&
!osgDB::equalCaseInsensitive(ext,"p3d")) return 0; !osgDB::equalCaseInsensitive(ext,"p3d")) return 0;
osg::ref_ptr<osgDB::ReaderWriter::Options> options = createOptions(0); osg::ref_ptr<osgDB::ReaderWriter::Options> options = createOptions(0);
@@ -216,24 +215,24 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
std::string filename; std::string filename;
while (arguments.read("--image",filename)) while (arguments.read("--image",filename))
{ {
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get()); osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get());
if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image)); if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image.get()));
} }
while (arguments.read("--movie",filename)) while (arguments.read("--movie",filename))
{ {
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get()); osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get());
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(image.get()); osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (imageStream) if (image.valid())
{ {
imageStream->play(); imageStream->play();
nodeList.push_back(osg::createGeodeForImage(imageStream)); nodeList.push_back(osg::createGeodeForImage(imageStream.get()));
} }
} }
while (arguments.read("--dem",filename)) while (arguments.read("--dem",filename))
{ {
osg::ref_ptr<osg::HeightField> hf = readRefHeightFieldFile(filename.c_str(), local_options.get()); osg::HeightField* hf = readHeightFieldFile(filename.c_str(), local_options.get());
if (hf) if (hf)
{ {
osg::Geode* geode = new osg::Geode; osg::Geode* geode = new osg::Geode;
@@ -248,7 +247,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
if (!arguments.isOption(pos)) if (!arguments.isOption(pos))
{ {
// not an option so assume string is a filename. // not an option so assume string is a filename.
osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFile( arguments[pos], local_options.get()); osg::Node *node = osgDB::readNodeFile( arguments[pos], local_options.get());
if(node) if(node)
{ {
@@ -257,16 +256,16 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
nodeList.push_back(node); nodeList.push_back(node);
// make sure that this presentation isn't cached // make sure that this presentation isn't cached
osgDB::Registry::instance()->removeFromObjectCache( arguments[pos], local_options.get()); osgDB::Registry::instance()->removeFromObjectCache( arguments[pos] );
} }
} }
} }
if (nodeList.empty()) if (nodeList.empty())
{ {
return NULL; return NULL;
} }
osg::ref_ptr<osg::Node> root; osg::ref_ptr<osg::Node> root;
if (nodeList.size()==1) if (nodeList.size()==1)
@@ -275,7 +274,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
} }
else // size >1 else // size >1
{ {
osg::Switch* sw = new osg::Switch; osg::Switch* sw = new osg::Switch;
for(NodeList::iterator itr=nodeList.begin(); for(NodeList::iterator itr=nodeList.begin();
itr!=nodeList.end(); itr!=nodeList.end();
@@ -284,7 +283,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
sw->addChild((*itr).get()); sw->addChild((*itr).get());
} }
sw->setSingleChildOn(0); sw->setSingleChildOn(0);
sw->setEventCallback(new p3d::ShowEventHandler()); sw->setEventCallback(new p3d::ShowEventHandler());
root = sw; root = sw;
@@ -293,7 +292,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
if (root.valid()) if (root.valid())
{ {
osg::notify(osg::INFO)<<"Got node now adding callback"<<std::endl; osg::notify(osg::INFO)<<"Got node now adding callback"<<std::endl;
AddVolumeEditingCallbackVisitor avecv; AddVolumeEditingCallbackVisitor avecv;
root->accept(avecv); root->accept(avecv);
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef P3D_READFILE #ifndef P3D_READFILE

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
@@ -34,7 +33,7 @@ SDLIntegration::SDLIntegration()
atexit(SDL_Quit); atexit(SDL_Quit);
int numJoysticks = SDL_NumJoysticks(); int numJoysticks = SDL_NumJoysticks();
if (_verbose) if (_verbose)
{ {
std::cout<<"number of joysticks "<<numJoysticks<<std::endl; std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
@@ -43,9 +42,9 @@ SDLIntegration::SDLIntegration()
std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl; std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl;
} }
} }
_joystick = numJoysticks>0 ? SDL_JoystickOpen(0) : 0; _joystick = numJoysticks>0 ? SDL_JoystickOpen(0) : 0;
_numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0; _numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0;
_numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0; _numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0;
_numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0; _numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0;
@@ -58,13 +57,13 @@ SDLIntegration::SDLIntegration()
std::cout<<"numHats = "<<_numHats<<std::endl; std::cout<<"numHats = "<<_numHats<<std::endl;
std::cout<<"numButtons = "<<_numButtons<<std::endl; std::cout<<"numButtons = "<<_numButtons<<std::endl;
} }
addMouseButtonMapping(4, 1); // left addMouseButtonMapping(4, 1); // left
addMouseButtonMapping(5, 3); // right addMouseButtonMapping(5, 3); // right
addMouseButtonMapping(6, 2); // middle addMouseButtonMapping(6, 2); // middle
addKeyMapping(10, ' '); // R2 addKeyMapping(10, ' '); // R2
addKeyMapping(0, '1'); // 1 addKeyMapping(0, '1'); // 1
addKeyMapping(1, '2'); // 2 addKeyMapping(1, '2'); // 2
addKeyMapping(2, '3'); // 3 addKeyMapping(2, '3'); // 3
@@ -89,7 +88,7 @@ void SDLIntegration::capture(ValueList& axisValues, ValueList& buttonValues) con
if (_joystick) if (_joystick)
{ {
SDL_JoystickUpdate(); SDL_JoystickUpdate();
axisValues.resize(_numAxes); axisValues.resize(_numAxes);
for(int ai=0; ai<_numAxes; ++ai) for(int ai=0; ai<_numAxes; ++ai)
{ {
@@ -108,21 +107,21 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
{ {
if (_joystick) if (_joystick)
{ {
ValueList newAxisValues; ValueList newAxisValues;
ValueList newButtonValues; ValueList newButtonValues;
capture(newAxisValues, newButtonValues); capture(newAxisValues, newButtonValues);
unsigned int mouseXaxis = 0; unsigned int mouseXaxis = 0;
unsigned int mouseYaxis = 1; unsigned int mouseYaxis = 1;
float prev_mx = (float)_axisValues[mouseXaxis]/32767.0f; float prev_mx = (float)_axisValues[mouseXaxis]/32767.0f;
float prev_my = -(float)_axisValues[mouseYaxis]/32767.0f; float prev_my = -(float)_axisValues[mouseYaxis]/32767.0f;
float mx = (float)newAxisValues[mouseXaxis]/32767.0f; float mx = (float)newAxisValues[mouseXaxis]/32767.0f;
float my = -(float)newAxisValues[mouseYaxis]/32767.0f; float my = -(float)newAxisValues[mouseYaxis]/32767.0f;
osgGA::EventQueue* eq = viewer.getEventQueue(); osgGA::EventQueue* eq = viewer.getEventQueue();
double time = eq ? eq->getTime() : 0.0; double time = eq ? eq->getTime() : 0.0;
@@ -146,7 +145,7 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
} }
} }
} }
for(int bi=0; bi<_numButtons; ++bi) for(int bi=0; bi<_numButtons; ++bi)
{ {
if (newButtonValues[bi]!=_buttonValues[bi]) if (newButtonValues[bi]!=_buttonValues[bi])
@@ -172,11 +171,11 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
} }
} }
} }
_axisValues.swap(newAxisValues); _axisValues.swap(newAxisValues);
_buttonValues.swap(newButtonValues); _buttonValues.swap(newButtonValues);
} }
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef SDLINTEGRATION #ifndef SDLINTEGRATION
@@ -32,12 +31,12 @@ class SDLIntegration
typedef std::map<int, int> ButtonMap; typedef std::map<int, int> ButtonMap;
void update(osgViewer::Viewer& viewer); void update(osgViewer::Viewer& viewer);
void addMouseButtonMapping(int joystickButton, int mouseButton) void addMouseButtonMapping(int joystickButton, int mouseButton)
{ {
_mouseButtonMap[joystickButton] = mouseButton; _mouseButtonMap[joystickButton] = mouseButton;
} }
int getMouseButtonMapping(int joystickButton) int getMouseButtonMapping(int joystickButton)
{ {
ButtonMap::const_iterator itr = _mouseButtonMap.find(joystickButton); ButtonMap::const_iterator itr = _mouseButtonMap.find(joystickButton);
@@ -49,16 +48,16 @@ class SDLIntegration
{ {
_keyMap[joystickButton] = key; _keyMap[joystickButton] = key;
} }
int getKeyMapping(int joystickButton) int getKeyMapping(int joystickButton)
{ {
ButtonMap::const_iterator itr = _keyMap.find(joystickButton); ButtonMap::const_iterator itr = _keyMap.find(joystickButton);
if (itr != _keyMap.end()) return itr->second; if (itr != _keyMap.end()) return itr->second;
else return -1; else return -1;
} }
protected: protected:
void capture(ValueList& axisValues, ValueList& buttonValues) const; void capture(ValueList& axisValues, ValueList& buttonValues) const;
SDL_Joystick* _joystick; SDL_Joystick* _joystick;
@@ -67,7 +66,7 @@ class SDLIntegration
int _numHats; int _numHats;
int _numButtons; int _numButtons;
bool _verbose; bool _verbose;
ValueList _axisValues; ValueList _axisValues;
ValueList _buttonValues; ValueList _buttonValues;
ButtonMap _mouseButtonMap; ButtonMap _mouseButtonMap;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include "ShowEventHandler.h" #include "ShowEventHandler.h"
@@ -29,13 +28,13 @@ bool ShowEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
case(osgGA::GUIEventAdapter::KEYUP): case(osgGA::GUIEventAdapter::KEYUP):
{ {
osg::notify(osg::INFO)<<"ShowEventHandler KEYUP "<<(int)ea.getKey()<<std::endl; osg::notify(osg::INFO)<<"ShowEventHandler KEYUP "<<(int)ea.getKey()<<std::endl;
if (ea.getKey()>=osgGA::GUIEventAdapter::KEY_F1 && if (ea.getKey()>=osgGA::GUIEventAdapter::KEY_F1 &&
ea.getKey()<=osgGA::GUIEventAdapter::KEY_F8) ea.getKey()<=osgGA::GUIEventAdapter::KEY_F8)
{ {
unsigned int child = ea.getKey()-osgGA::GUIEventAdapter::KEY_F1; unsigned int child = ea.getKey()-osgGA::GUIEventAdapter::KEY_F1;
osg::notify(osg::INFO)<<" Select "<<child<<std::endl; osg::notify(osg::INFO)<<" Select "<<child<<std::endl;
osg::Switch* showSwitch = dynamic_cast<osg::Switch*>(object); osg::Switch* showSwitch = dynamic_cast<osg::Switch*>(object);
if (showSwitch) if (showSwitch)
{ {
if (child<showSwitch->getNumChildren()) if (child<showSwitch->getNumChildren())
{ {
@@ -53,6 +52,12 @@ bool ShowEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
return false; return false;
} }
void ShowEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
{
v.visit(*this);
}
void ShowEventHandler::getUsage(osg::ApplicationUsage& /*usage*/) const void ShowEventHandler::getUsage(osg::ApplicationUsage& /*usage*/) const
{ {
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef SHOWEVENTHANDLER #ifndef SHOWEVENTHANDLER
@@ -29,9 +28,11 @@ class ShowEventHandler : public osgGA::GUIEventHandler
ShowEventHandler(); ShowEventHandler();
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv); virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv);
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
virtual void getUsage(osg::ApplicationUsage& usage) const; virtual void getUsage(osg::ApplicationUsage& usage) const;
}; };
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website.
* *
* This library is distributed in the hope that it will be useful, * This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include <osgDB/FileNameUtils> #include <osgDB/FileNameUtils>
@@ -87,7 +86,7 @@ bool SpellChecker::isCorrect(const std::string& word) const
return true; return true;
} }
SpellChecker::WordList SpellChecker::suggest(const std::string& /*word*/) const SpellChecker::WordList SpellChecker::suggest(const std::string& word) const
{ {
return WordList(); return WordList();
} }

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website.
* *
* This library is distributed in the hope that it will be useful, * This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#ifndef SPELLCHCKER_H #ifndef SPELLCHCKER_H

View File

@@ -1,17 +1,17 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
* *
* This library is open source and may be redistributed and/or modified under * This software is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the GNU General Public License (GPL) version 2.0.
* (at your option) any later version. The full license is in LICENSE file * The full license is in LICENSE.txt file included with this distribution,.
* included with this distribution, and on the openscenegraph.org website. *
* * This software is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * include LICENSE.txt for more details.
*/ */
#include <osg/Geometry> #include <osg/Geometry>
#include <osg/CameraNode>
#include <osg/Texture2D> #include <osg/Texture2D>
#include <osg/AutoTransform> #include <osg/AutoTransform>
#include <osg/Notify> #include <osg/Notify>
@@ -37,10 +37,9 @@
#include <osgGA/TerrainManipulator> #include <osgGA/TerrainManipulator>
#include <osgGA/AnimationPathManipulator> #include <osgGA/AnimationPathManipulator>
#include <osgGA/StateSetManipulator> #include <osgGA/StateSetManipulator>
#include <osgGA/MultiTouchTrackballManipulator>
#include <osgPresentation/SlideEventHandler> #include <osgPresentation/SlideEventHandler>
#include <osgPresentation/Cursor> #include <osgPresentation/SlideShowConstructor>
#include "ReadShowFile.h" #include "ReadShowFile.h"
#include "PointsEventHandler.h" #include "PointsEventHandler.h"
@@ -52,7 +51,6 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <string.h> #include <string.h>
#ifdef USE_SDL #ifdef USE_SDL
@@ -131,103 +129,148 @@ void setViewer(osgViewer::Viewer& viewer, float width, float height, float dista
viewer.getCamera()->setProjectionMatrixAsPerspective( vfov, width/height, 0.1, 1000.0); viewer.getCamera()->setProjectionMatrixAsPerspective( vfov, width/height, 0.1, 1000.0);
OSG_INFO<<"setProjectionMatrixAsPerspective( "<<vfov<<", "<<width/height<<", "<<0.1<<", "<<1000.0<<");"<<std::endl; OSG_NOTICE<<"setProjectionMatrixAsPerspective( "<<vfov<<", "<<width/height<<", "<<0.1<<", "<<1000.0<<");"<<std::endl;
} }
class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler { class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
public: public:
ForwardToDeviceEventHandler(osgGA::Device* device, bool format_mouse_events) : osgGA::GUIEventHandler(), _device(device), _forwardMouseEvents(format_mouse_events) {} ForwardToDeviceEventHandler(osgGA::Device* device) : osgGA::GUIEventHandler(), _device(device) {}
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *) virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
{ {
switch (ea.getEventType()) OSG_INFO<<"ForwardToDeviceEventHandler::setEvent("<<ea.getKey()<<")"<<std::endl;
{ _device->sendEvent(ea);
case osgGA::GUIEventAdapter::PUSH:
case osgGA::GUIEventAdapter::RELEASE:
case osgGA::GUIEventAdapter::MOVE:
case osgGA::GUIEventAdapter::DRAG:
case osgGA::GUIEventAdapter::SCROLL:
if (_forwardMouseEvents)
_device->sendEvent(ea);
break;
default:
_device->sendEvent(ea);
break;
}
return false; return false;
} }
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
{
if (event->asGUIEventAdapter())
return osgGA::GUIEventHandler::handle(event, object, nv);
else
{
_device->sendEvent(*event);
return false;
}
}
private: private:
osg::ref_ptr<osgGA::Device> _device; osg::ref_ptr<osgGA::Device> _device;
bool _forwardMouseEvents;
}; };
class DumpEventHandler : public osgGA::GUIEventHandler { class FollowMouseCallback: public osgGA::GUIEventHandler
public: {
DumpEventHandler() : osgGA::GUIEventHandler() {} public:
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *) FollowMouseCallback():
{ _mousePostition(0.5,0.5) {}
switch (ea.getEventType())
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv)
{ {
case osgGA::GUIEventAdapter::FRAME: osg::AutoTransform* transform = dynamic_cast<osg::AutoTransform*>(object);
return false; if (!transform) return false;
break;
case osgGA::GUIEventAdapter::PUSH:
std::cout << "PUSH: ";
break;
case osgGA::GUIEventAdapter::RELEASE:
std::cout << "RELEASE: ";
break;
case osgGA::GUIEventAdapter::MOVE:
std::cout << "MOVE: ";
break;
case osgGA::GUIEventAdapter::DRAG:
std::cout << "DRAG: ";
break;
case osgGA::GUIEventAdapter::SCROLL:
std::cout << "SCROLL: ";
break;
break;
default: osg::NotifySeverity level = osg::INFO;
std::cout << ea.getEventType() << " ";
break; switch(ea.getEventType())
} {
std::cout << ea.getX() << "/" << ea.getY() << " " << ea.isMultiTouchEvent() << std::endl; case(osgGA::GUIEventAdapter::PUSH):
return false; case(osgGA::GUIEventAdapter::RELEASE):
} case(osgGA::GUIEventAdapter::MOVE):
case(osgGA::GUIEventAdapter::DRAG):
osg::notify(level)<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl;
osg::notify(level)<<"ea.getWindowWidth()="<<ea.getWindowWidth()<<std::endl;
osg::notify(level)<<"ea.getWindowHeight()="<<ea.getWindowHeight()<<std::endl;
osg::notify(level)<<"ea.getX()="<<ea.getX()<<std::endl;
osg::notify(level)<<"ea.getXin()="<<ea.getXmin()<<std::endl;
osg::notify(level)<<"ea.getXmax()="<<ea.getXmax()<<std::endl;
osg::notify(level)<<"ea.getY()="<<ea.getY()<<std::endl;
osg::notify(level)<<"ea.getYin()="<<ea.getYmin()<<std::endl;
osg::notify(level)<<"ea.getYmax()="<<ea.getYmax()<<std::endl;
_mousePostition.set(ea.getXnormalized(), ea.getYnormalized());
break;
case(osgGA::GUIEventAdapter::FRAME):
{
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv) osg::Camera* camera = view->getCamera();
{ osg::Matrix VP = camera->getViewMatrix() * camera->getProjectionMatrix();
if (event->asGUIEventAdapter())
return osgGA::GUIEventHandler::handle(event, object, nv); osg::Matrix inverse_VP;
else inverse_VP.invert(VP);
{
osg::Vec3d start_eye(_mousePostition.x(), _mousePostition.y(), 0.0);
osg::Vec3d end_eye(_mousePostition.x(), _mousePostition.y(), 1.0);
osg::Vec3d start_world = start_eye * inverse_VP;
osg::Vec3d end_world = start_eye * inverse_VP;
osg::notify(level)<<"start_world="<<start_world<<std::endl;
osg::notify(level)<<"end_world="<<end_world<<std::endl;
if (end_world.valid()) transform->setPosition(end_world);
else
{
OSG_NOTICE<<"Ignoring invalid end_world position"<<std::endl;
}
break;
}
case(osgGA::GUIEventAdapter::KEYDOWN):
{
if (ea.getKey()=='c')
{
for(unsigned int i=0; i< transform->getNumChildren(); ++i)
{
osg::Node* node = transform->getChild(i);
node->setNodeMask(
node->getNodeMask()!=0 ?
0 :
0xffffff);
}
}
break;
}
default:
break;
}
return false; return false;
} }
}
virtual void accept(osgGA::GUIEventHandlerVisitor& v)
{
v.visit(*this);
}
private: osg::Vec2d _mousePostition;
}; };
osg::Node* createCursorSubgraph(const std::string& filename, float size)
{
osg::Geode* geode = new osg::Geode;
size = 20.0f;
osg::Geometry* geom = osg::createTexturedQuadGeometry(osg::Vec3(-size*0.5f,-size*0.5f,0.0f),osg::Vec3(size,0.0f,0.0f),osg::Vec3(0.0f,size,0.0f));
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
osg::Image* image = osgDB::readImageFile(osgDB::findDataFile(filename));
if (image)
{
osg::StateSet* stateset = geom->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(0, new osg::Texture2D(image),osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
stateset->setMode(GL_BLEND,osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
// stateset->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
stateset->setRenderBinDetails(1000, "DepthSortedBin");
}
geode->addDrawable(geom);
osg::AutoTransform* transform = new osg::AutoTransform;
transform->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_CAMERA);
transform->setAutoScaleToScreen(true);
transform->addChild(geode);
transform->setEventCallback(new FollowMouseCallback());
return transform;
}
enum P3DApplicationType enum P3DApplicationType
@@ -241,7 +284,7 @@ enum P3DApplicationType
void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_options, const std::string& cursorFileName) void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_options, const std::string& cursorFileName)
{ {
if (!loadedModel) return; if (!loadedModel) return;
#if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) #if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE)
// add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins. // add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins.
@@ -249,7 +292,7 @@ void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_opti
loadedModel->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON); loadedModel->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
#endif #endif
// optimize the scene graph, remove redundant nodes and state etc. // optimize the scene graph, remove rendundent nodes and state etc.
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel.get(), optimizer_options); optimizer.optimize(loadedModel.get(), optimizer_options);
@@ -257,24 +300,21 @@ void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_opti
{ {
osg::ref_ptr<osg::Group> group = new osg::Group; osg::ref_ptr<osg::Group> group = new osg::Group;
group->addChild(loadedModel.get()); group->addChild(loadedModel.get());
group->addChild(createCursorSubgraph(cursorFileName, 0.05f));
OSG_NOTICE<<"Creating Cursor"<<std::endl;
group->addChild(new osgPresentation::Cursor(cursorFileName, 20.0f));
loadedModel = group; loadedModel = group;
} }
} }
void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name, bool forward_mouse_events) void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name)
{ {
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device_name); osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device_name);
if (dev.valid()) if (dev.valid())
{ {
OSG_INFO << "Adding Device : " << device_name << std::endl; OSG_INFO << "Adding Device : " << device_name << std::endl;
viewer.addDevice(dev.get()); viewer.addDevice(dev.get());
if ((dev->getCapabilities() & osgGA::Device::SEND_EVENTS)) if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS)
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get(), forward_mouse_events)); viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get()));
} }
else else
{ {
@@ -287,7 +327,7 @@ int main( int argc, char **argv )
{ {
// use an ArgumentParser object to manage the program arguments. // use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program. // set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the application for presenting 3D interactive slide shows."); arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the application for presenting 3D interactive slide shows.");
@@ -308,8 +348,6 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("--html <filename>","Print out slides to a series of html & image files."); arguments.getApplicationUsage()->addCommandLineOption("--html <filename>","Print out slides to a series of html & image files.");
arguments.getApplicationUsage()->addCommandLineOption("--loop","Switch on looping of presentation."); arguments.getApplicationUsage()->addCommandLineOption("--loop","Switch on looping of presentation.");
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit."); arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
arguments.getApplicationUsage()->addCommandLineOption("--forwardMouseEvents","forward also mouse/touch-events to the devices");
arguments.getApplicationUsage()->addCommandLineOption("--suppressEnvTags", "suppresses all found ENV-tags in the presentation");
// add alias from xml to p3d to provide backwards compatibility for old p3d files. // add alias from xml to p3d to provide backwards compatibility for old p3d files.
osgDB::Registry::instance()->addFileExtensionAlias("xml","p3d"); osgDB::Registry::instance()->addFileExtensionAlias("xml","p3d");
@@ -318,17 +356,14 @@ int main( int argc, char **argv )
if (arguments.read("-devices") || arguments.read("--devices")) if (arguments.read("-devices") || arguments.read("--devices"))
{ {
// Force load QuickTime plugin, probe video capability, exit // Force load QuickTime plugin, probe video capability, exit
osgDB::readRefImageFile("devices.live"); osgDB::readImageFile("devices.live");
return 1; return 1;
} }
bool suppress_env_tags = false;
if (arguments.read("--suppressEnvTags"))
suppress_env_tags = true;
// read any env vars from presentations before we create viewer to make sure the viewer // read any env vars from presentations before we create viewer to make sure the viewer
// utilises these env vars // utilises these env vars
if (!suppress_env_tags && p3d::readEnvVars(arguments)) if (p3d::readEnvVars(arguments))
{ {
osg::DisplaySettings::instance()->readEnvironmentalVariables(); osg::DisplaySettings::instance()->readEnvironmentalVariables();
} }
@@ -337,20 +372,24 @@ int main( int argc, char **argv )
std::string url, username, password; std::string url, username, password;
while(arguments.read("--login",url, username, password)) while(arguments.read("--login",url, username, password))
{ {
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails( if (!osgDB::Registry::instance()->getAuthenticationMap())
url, {
new osgDB::AuthenticationDetails(username, password) osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
); osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
} }
#ifdef USE_SDL #ifdef USE_SDL
SDLIntegration sdlIntegration; SDLIntegration sdlIntegration;
osg::notify(osg::INFO)<<"USE_SDL"<<std::endl; osg::notify(osg::INFO)<<"USE_SDL"<<std::endl;
#endif #endif
bool doSetViewer = true; bool doSetViewer = true;
std::string configurationFile; std::string configurationFile;
@@ -363,7 +402,7 @@ int main( int argc, char **argv )
while (arguments.read("-c",configurationFile)) {} while (arguments.read("-c",configurationFile)) {}
osg::Vec4 clearColor(0.0f,0.0f,0.0f,0.0f); osg::Vec4 clearColor(0.0f,0.0f,0.0f,0.0f);
while (arguments.read("--clear-color",clearColor[0],clearColor[1],clearColor[2],clearColor[3])) {} while (arguments.read("--clear-color",clearColor[0],clearColor[1],clearColor[2],clearColor[3])) {}
std::string filename; std::string filename;
@@ -402,7 +441,7 @@ int main( int argc, char **argv )
// construct the viewer. // construct the viewer.
osgViewer::Viewer viewer(arguments); osgViewer::Viewer viewer(arguments);
// set clear colour to black by default. // set clear colour to black by default.
viewer.getCamera()->setClearColor(clearColor); viewer.getCamera()->setClearColor(clearColor);
@@ -412,10 +451,6 @@ int main( int argc, char **argv )
doSetViewer = false; doSetViewer = false;
} }
bool forwardMouseEvents = false;
if (arguments.read("--forwardMouseEvents"))
forwardMouseEvents = true;
const char* p3dDevice = getenv("P3D_DEVICE"); const char* p3dDevice = getenv("P3D_DEVICE");
if (p3dDevice) if (p3dDevice)
{ {
@@ -423,7 +458,7 @@ int main( int argc, char **argv )
osgDB::split(p3dDevice, devices); osgDB::split(p3dDevice, devices);
for(osgDB::StringList::iterator i = devices.begin(); i != devices.end(); ++i) for(osgDB::StringList::iterator i = devices.begin(); i != devices.end(); ++i)
{ {
addDeviceTo(viewer, *i, forwardMouseEvents); addDeviceTo(viewer, *i);
} }
} }
@@ -431,13 +466,13 @@ int main( int argc, char **argv )
std::string device; std::string device;
while (arguments.read("--device", device)) while (arguments.read("--device", device))
{ {
addDeviceTo(viewer, device, forwardMouseEvents); addDeviceTo(viewer, device);
} }
if (arguments.read("--http-control")) if (arguments.read("--http-control"))
{ {
std::string server_address = "localhost"; std::string server_address = "localhost";
std::string server_port = "8080"; std::string server_port = "8080";
std::string document_root = "htdocs"; std::string document_root = "htdocs";
@@ -448,33 +483,23 @@ int main( int argc, char **argv )
osg::ref_ptr<osgDB::Options> device_options = new osgDB::Options("documentRegisteredHandlers"); osg::ref_ptr<osgDB::Options> device_options = new osgDB::Options("documentRegisteredHandlers");
osg::ref_ptr<osgGA::Device> rest_http_device = osgDB::readRefFile<osgGA::Device>(server_address+":"+server_port+"/"+document_root+".resthttp", device_options.get()); osg::ref_ptr<osgGA::Device> rest_http_device = osgDB::readFile<osgGA::Device>(server_address+":"+server_port+"/"+document_root+".resthttp", device_options.get());
if (rest_http_device.valid()) if (rest_http_device.valid())
{ {
viewer.addDevice(rest_http_device.get()); viewer.addDevice(rest_http_device.get());
} }
} }
// set up stereo masks // set up stereo masks
viewer.getCamera()->setCullMask(0xffffffff);
viewer.getCamera()->setCullMaskLeft(0x00000001); viewer.getCamera()->setCullMaskLeft(0x00000001);
viewer.getCamera()->setCullMaskRight(0x00000002); viewer.getCamera()->setCullMaskRight(0x00000002);
bool assignLeftCullMaskForMono = true;
if (assignLeftCullMaskForMono)
{
viewer.getCamera()->setCullMask(viewer.getCamera()->getCullMaskLeft());
}
else
{
viewer.getCamera()->setCullMask(0xffffffff);
}
// set up the camera manipulators. // set up the camera manipulators.
{ {
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::MultiTouchTrackballManipulator() ); keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
@@ -484,7 +509,7 @@ int main( int argc, char **argv )
while (arguments.read("-p",pathfile)) while (arguments.read("-p",pathfile))
{ {
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid()) if (apm || !apm->valid())
{ {
unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
@@ -496,8 +521,6 @@ int main( int argc, char **argv )
viewer.setCameraManipulator( keyswitchManipulator.get() ); viewer.setCameraManipulator( keyswitchManipulator.get() );
} }
//viewer.getEventHandlers().push_front(new DumpEventHandler());
// add the state manipulator // add the state manipulator
osg::ref_ptr<osgGA::StateSetManipulator> ssManipulator = new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()); osg::ref_ptr<osgGA::StateSetManipulator> ssManipulator = new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet());
ssManipulator->setKeyEventToggleTexturing('e'); ssManipulator->setKeyEventToggleTexturing('e');
@@ -524,12 +547,12 @@ int main( int argc, char **argv )
bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no"); bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no");
while (arguments.read("--set-viewer")) { doSetViewer = true; } while (arguments.read("--set-viewer")) { doSetViewer = true; }
while (arguments.read("--no-set-viewer")) { doSetViewer = false; } while (arguments.read("--no-set-viewer")) { doSetViewer = false; }
// if we want to hide the cursor override the custom cursor. // if we want to hide the cursor override the custom cursor.
if (hideCursor) cursorFileName.clear(); if (hideCursor) cursorFileName.clear();
// cluster related entries. // cluster related entries.
int socketNumber=8100; int socketNumber=8100;
@@ -576,7 +599,7 @@ int main( int argc, char **argv )
viewer.getUpdateVisitor()->setTraversalMode(updateTraversalMode); viewer.getUpdateVisitor()->setTraversalMode(updateTraversalMode);
} }
// register the slide event handler - which moves the presentation from slide to slide, layer to layer. // register the slide event handler - which moves the presentation from slide to slide, layer to layer.
osg::ref_ptr<osgPresentation::SlideEventHandler> seh = new osgPresentation::SlideEventHandler(&viewer); osg::ref_ptr<osgPresentation::SlideEventHandler> seh = new osgPresentation::SlideEventHandler(&viewer);
viewer.addEventHandler(seh.get()); viewer.addEventHandler(seh.get());
@@ -596,19 +619,19 @@ int main( int argc, char **argv )
// set up optimizer options // set up optimizer options
unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS; unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS;
bool release_and_compile = false; bool relase_and_compile = false;
while (arguments.read("--release-and-compile")) while (arguments.read("--release-and-compile"))
{ {
release_and_compile = true; relase_and_compile = true;
} }
seh->setReleaseAndCompileOnEachNewSlide(release_and_compile); seh->setReleaseAndCompileOnEachNewSlide(relase_and_compile);
if (release_and_compile) if (relase_and_compile)
{ {
// make sure that imagery stays around after being applied to textures. // make sure that imagery stays around after being applied to textures.
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false); viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS; optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
} }
// //
// osgDB::Registry::instance()->getOrCreateDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false); // osgDB::Registry::instance()->getOrCreateDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
// optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS; // optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
// osg::Texture::getTextureObjectManager()->setExpiryDelay(0.0f); // osg::Texture::getTextureObjectManager()->setExpiryDelay(0.0f);
@@ -634,7 +657,7 @@ int main( int argc, char **argv )
float width = osg::DisplaySettings::instance()->getScreenWidth(); float width = osg::DisplaySettings::instance()->getScreenWidth();
float height = osg::DisplaySettings::instance()->getScreenHeight(); float height = osg::DisplaySettings::instance()->getScreenHeight();
float distance = osg::DisplaySettings::instance()->getScreenDistance(); float distance = osg::DisplaySettings::instance()->getScreenDistance();
while (arguments.read("-s", width, height, distance)) while (arguments.read("-s", width, height, distance))
{ {
osg::DisplaySettings::instance()->setScreenDistance(distance); osg::DisplaySettings::instance()->setScreenDistance(distance);
osg::DisplaySettings::instance()->setScreenHeight(height); osg::DisplaySettings::instance()->setScreenHeight(height);
@@ -649,10 +672,9 @@ int main( int argc, char **argv )
viewer.getUsage(*arguments.getApplicationUsage()); viewer.getUsage(*arguments.getApplicationUsage());
// if user request help write it out to cout. // if user request help write it out to cout.
unsigned int helpType = 0; if (arguments.read("-h") || arguments.read("--help"))
if ((helpType = arguments.readHelpType()))
{ {
arguments.getApplicationUsage()->write(std::cout, helpType); arguments.getApplicationUsage()->write(osg::notify(osg::NOTICE));
return 1; return 1;
} }
@@ -665,11 +687,11 @@ int main( int argc, char **argv )
else if (strcmp(str,"master")==0) P3DApplicationType = MASTER; else if (strcmp(str,"master")==0) P3DApplicationType = MASTER;
else if (strcmp(str,"slave")==0) P3DApplicationType = SLAVE; else if (strcmp(str,"slave")==0) P3DApplicationType = SLAVE;
} }
while (arguments.read("--viewer")) { P3DApplicationType = VIEWER; } while (arguments.read("--viewer")) { P3DApplicationType = VIEWER; }
while (arguments.read("--master")) { P3DApplicationType = MASTER; } while (arguments.read("--master")) { P3DApplicationType = MASTER; }
while (arguments.read("--slave")) { P3DApplicationType = SLAVE; } while (arguments.read("--slave")) { P3DApplicationType = SLAVE; }
while (arguments.read("--version")) while (arguments.read("--version"))
{ {
std::string appTypeName = "invalid"; std::string appTypeName = "invalid";
@@ -747,9 +769,6 @@ int main( int argc, char **argv )
osg::ref_ptr<osgDB::ReaderWriter::Options> cacheAllOption = new osgDB::ReaderWriter::Options; osg::ref_ptr<osgDB::ReaderWriter::Options> cacheAllOption = new osgDB::ReaderWriter::Options;
if(suppress_env_tags)
cacheAllOption->setPluginStringData("suppressEnvTags", "true");
cacheAllOption->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL); cacheAllOption->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
osgDB::Registry::instance()->setOptions(cacheAllOption.get()); osgDB::Registry::instance()->setOptions(cacheAllOption.get());
@@ -761,7 +780,7 @@ int main( int argc, char **argv )
// if no model has been successfully loaded report failure. // if no model has been successfully loaded report failure.
if (!loadedModel) if (!loadedModel)
{ {
osg::notify(osg::INFO) << arguments.getApplicationName() <<": No data loaded" << std::endl; osg::notify(osg::INFO) << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1; return 1;
@@ -777,12 +796,12 @@ int main( int argc, char **argv )
for(unsigned int i=0; i<loadedModel->getNumDescriptions(); ++i) for(unsigned int i=0; i<loadedModel->getNumDescriptions(); ++i)
{ {
const std::string& desc = loadedModel->getDescription(i); const std::string& desc = loadedModel->getDescription(i);
if (desc=="loop") if (desc=="loop")
{ {
osg::notify(osg::NOTICE)<<"Enabling looping"<<std::endl; osg::notify(osg::NOTICE)<<"Enabling looping"<<std::endl;
seh->setLoopPresentation(true); seh->setLoopPresentation(true);
} }
else if (desc=="auto") else if (desc=="auto")
{ {
osg::notify(osg::NOTICE)<<"Enabling auto run"<<std::endl; osg::notify(osg::NOTICE)<<"Enabling auto run"<<std::endl;
seh->setAutoSteppingActive(true); seh->setAutoSteppingActive(true);
@@ -811,7 +830,7 @@ int main( int argc, char **argv )
} }
// pass the model to the slide event handler so it knows which to manipulate. // pass the model to the slide event handler so it knows which to manipulate.
seh->set(loadedModel.get()); seh->set(loadedModel.get());
@@ -824,7 +843,7 @@ int main( int argc, char **argv )
osgDB::writeNodeFile(*loadedModel,outputFileName); osgDB::writeNodeFile(*loadedModel,outputFileName);
return 0; return 0;
} }
if (!cursorFileName.empty() || hideCursor) if (!cursorFileName.empty() || hideCursor)
{ {
@@ -844,11 +863,12 @@ int main( int argc, char **argv )
} }
} }
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
double targetFrameTime = 1.0/targetFrameRate; double targetFrameTime = 1.0/targetFrameRate;
if (exportName.empty()) if (exportName.empty())
{ {
// objects for managing the broadcasting and receiving of camera packets. // objects for managing the broadcasting and recieving of camera packets.
CameraPacket cp; CameraPacket cp;
Broadcaster bc; Broadcaster bc;
Receiver rc; Receiver rc;
@@ -860,124 +880,123 @@ int main( int argc, char **argv )
while( !viewer.done() && !masterKilled) while( !viewer.done() && !masterKilled)
{ {
osg::Timer_t startFrameTick = osg::Timer::instance()->tick(); // wait for all cull and draw threads to complete.
viewer.advance();
if (viewer.getRunFrameScheme()!=osgViewer::ViewerBase::ON_DEMAND || seh->checkNeedToDoFrame()) osg::Timer_t currentTick = osg::Timer::instance()->tick();
double deltaTime = osg::Timer::instance()->delta_s(startOfFrameTick, currentTick);
if (deltaTime<targetFrameTime)
{ {
// do the normal frame. OpenThreads::Thread::microSleep(static_cast<unsigned int>((targetFrameTime-deltaTime)*1000000.0));
// wait for all cull and draw threads to complete.
viewer.advance();
#if 0
if (kmcb)
{
double time = kmcb->getTime();
viewer.getFrameStamp()->setReferenceTime(time);
}
#endif
#ifdef USE_SDL
sdlIntegration.update(viewer);
#endif
if (P3DApplicationType==MASTER)
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp.setPacket(modelview,viewer.getFrameStamp());
// cp.readEventQueue(viewer);
scratchPad.reset();
scratchPad.write(cp);
scratchPad.reset();
scratchPad.read(cp);
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
bc.sync();
}
else if (P3DApplicationType==SLAVE)
{
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
rc.sync();
scratchPad.reset();
scratchPad.read(cp);
// cp.writeEventQueue(viewer);
if (cp.getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
masterKilled = true;
}
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.eventTraversal();
if (seh->getRequestReload())
{
OSG_INFO<<"Reload requested"<<std::endl;
seh->setRequestReload(false);
int previous_ActiveSlide = seh->getActiveSlide();
int previous_ActiveLayer = seh->getActiveLayer();
// reset time so any event key generate
loadedModel = p3d::readShowFiles(arguments,cacheAllOption.get());
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
if (!loadedModel)
{
return 0;
}
viewer.setSceneData(loadedModel.get());
seh->set(loadedModel.get());
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
continue;
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.updateTraversal();
if (P3DApplicationType==SLAVE)
{
osg::Matrix modelview;
cp.getModelView(modelview,camera_offset);
viewer.getCamera()->setViewMatrix(modelview);
}
// fire off the cull and draw traversals of the scene.
if(!masterKilled)
viewer.renderingTraversals();
} }
// work out if we need to force a sleep to hold back the frame rate startOfFrameTick = osg::Timer::instance()->tick();
osg::Timer_t endFrameTick = osg::Timer::instance()->tick();
double frameTime = osg::Timer::instance()->delta_s(startFrameTick, endFrameTick); #if 0
if (frameTime < targetFrameTime) OpenThreads::Thread::microSleep(static_cast<unsigned int>(1000000.0*(targetFrameTime-frameTime))); if (kmcb)
{
double time = kmcb->getTime();
viewer.getFrameStamp()->setReferenceTime(time);
}
#endif
#ifdef USE_SDL
sdlIntegration.update(viewer);
#endif
if (P3DApplicationType==MASTER)
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp.setPacket(modelview,viewer.getFrameStamp());
// cp.readEventQueue(viewer);
scratchPad.reset();
scratchPad.write(cp);
scratchPad.reset();
scratchPad.read(cp);
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
bc.sync();
}
else if (P3DApplicationType==SLAVE)
{
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
rc.sync();
scratchPad.reset();
scratchPad.read(cp);
// cp.writeEventQueue(viewer);
if (cp.getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
masterKilled = true;
}
}
// update the scene by traversing it with the the update visitor which will
// call all node update callbacks and animations.
viewer.eventTraversal();
if (seh->getRequestReload())
{
OSG_INFO<<"Reload requested"<<std::endl;
seh->setRequestReload(false);
int previous_ActiveSlide = seh->getActiveSlide();
int previous_ActiveLayer = seh->getActiveLayer();
// reset time so any event key generate
loadedModel = p3d::readShowFiles(arguments,cacheAllOption.get());
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
if (!loadedModel)
{
return 0;
}
viewer.setSceneData(loadedModel.get());
seh->set(loadedModel.get());
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
continue;
}
// update the scene by traversing it with the the update visitor which will
// call all node update callbacks and animations.
viewer.updateTraversal();
if (P3DApplicationType==SLAVE)
{
osg::Matrix modelview;
cp.getModelView(modelview,camera_offset);
viewer.getCamera()->setViewMatrix(modelview);
}
// fire off the cull and draw traversals of the scene.
if(!masterKilled)
viewer.renderingTraversals();
} }
} }
else else
{ {
ExportHTML::write(seh.get(), viewer, exportName); ExportHTML::write(seh.get(), viewer, exportName);
} }
return 0; return 0;
} }

1
configure vendored Executable file
View File

@@ -0,0 +1 @@
cmake . -DCMAKE_BUILD_TYPE=Release $@

View File

@@ -1 +0,0 @@
ldconfig

View File

@@ -39,7 +39,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO SIP_SUPPORT = NO

View File

@@ -39,7 +39,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO SIP_SUPPORT = NO
@@ -99,16 +98,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \ ${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \ ${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \ ${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \ ${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \ ${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \ ${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \ ${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \ ${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \ ${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \ ${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \ ${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \ FILE_PATTERNS = *include* \

View File

@@ -169,25 +169,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING = no_extension=C++
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of # Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a # the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to # subgroup of that type (e.g. under the Public Functions section). Set it to

View File

@@ -29,7 +29,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO SIP_SUPPORT = NO
@@ -89,16 +88,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \ ${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \ ${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \ ${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \ ${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \ ${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \ ${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \ ${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \ ${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \ ${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \ ${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \ ${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \ FILE_PATTERNS = *include* \

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/" STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = YES SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8 TAB_SIZE = 8
ALIASES = ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -63,13 +63,13 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES SHOW_USED_FILES = YES
SHOW_FILES = YES SHOW_FILES = YES
SHOW_NAMESPACES = YES SHOW_NAMESPACES = YES
FILE_VERSION_FILTER = FILE_VERSION_FILTER =
LAYOUT_FILE = LAYOUT_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -79,27 +79,26 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \ INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgDB" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgDB" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgFX" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgFX" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgText" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgText" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUI" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUtil" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgUtil" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgViewer" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgViewer" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgVolume" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgVolume" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgWidget" "${OpenSceneGraph_SOURCE_DIR}/include/osgWidget" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation"
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \ FILE_PATTERNS = *include* \
*.cpp *.cpp
@@ -107,13 +106,13 @@ RECURSIVE = YES
EXCLUDE = .svn EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/* EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS = EXCLUDE_SYMBOLS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
IMAGE_PATH = IMAGE_PATH =
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
@@ -131,16 +130,16 @@ VERBATIM_HEADERS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2 COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = OpenSceneGraphReferenceDocs HTML_OUTPUT = OpenSceneGraphReferenceDocs
HTML_FILE_EXTENSION = .html HTML_FILE_EXTENSION = .html
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html" HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_DYNAMIC_SECTIONS = NO HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -149,14 +148,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../${CMAKE_PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm" CHM_FILE = "../${CMAKE_PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}" HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO GENERATE_CHI = NO
CHM_INDEX_ENCODING = CHM_INDEX_ENCODING =
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = NO TOC_EXPAND = NO
GENERATE_QHP = NO GENERATE_QHP = NO
QCH_FILE = QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION = QHG_LOCATION =
DISABLE_INDEX = NO DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4 ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
@@ -171,8 +170,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = LATEX_HEADER =
PDF_HYPERLINKS = NO PDF_HYPERLINKS = NO
USE_PDFLATEX = NO USE_PDFLATEX = NO
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
@@ -184,8 +183,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE = RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -198,6 +197,8 @@ MAN_LINKS = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_XML = NO GENERATE_XML = NO
XML_OUTPUT = xml XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES XML_PROGRAMLISTING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output # configuration options for the AutoGen Definitions output
@@ -209,36 +210,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX = PERLMOD_MAKEVAR_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE} GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
MSCGEN_PATH = MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10 DOT_FONTSIZE = 10
DOT_FONTPATH = DOT_FONTPATH =
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES GROUP_GRAPHS = YES
@@ -252,7 +254,7 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = "${DOXYGEN_DOT_PATH}" DOT_PATH = "${DOXYGEN_DOT_PATH}"
DOTFILE_DIRS = DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50 DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0 MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES DOT_TRANSPARENT = YES
@@ -260,6 +262,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES GENERATE_LEGEND = YES
DOT_CLEANUP = YES DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to the search engine # Configuration::additions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE} SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/" STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = YES SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8 TAB_SIZE = 8
ALIASES = ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -63,13 +63,13 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES SHOW_USED_FILES = YES
SHOW_FILES = YES SHOW_FILES = YES
SHOW_NAMESPACES = YES SHOW_NAMESPACES = YES
FILE_VERSION_FILTER = FILE_VERSION_FILTER =
LAYOUT_FILE = LAYOUT_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -79,7 +79,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -91,13 +91,13 @@ RECURSIVE = YES
EXCLUDE = .svn EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/* EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS = EXCLUDE_SYMBOLS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
IMAGE_PATH = IMAGE_PATH =
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
@@ -115,16 +115,16 @@ VERBATIM_HEADERS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2 COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = OpenThreadsReferenceDocs HTML_OUTPUT = OpenThreadsReferenceDocs
HTML_FILE_EXTENSION = .html HTML_FILE_EXTENSION = .html
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html" HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_DYNAMIC_SECTIONS = NO HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -133,14 +133,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm" CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}" HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO GENERATE_CHI = NO
CHM_INDEX_ENCODING = CHM_INDEX_ENCODING =
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = NO TOC_EXPAND = NO
GENERATE_QHP = NO GENERATE_QHP = NO
QCH_FILE = QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION = QHG_LOCATION =
DISABLE_INDEX = NO DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4 ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
@@ -155,8 +155,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = LATEX_HEADER =
PDF_HYPERLINKS = NO PDF_HYPERLINKS = NO
USE_PDFLATEX = NO USE_PDFLATEX = NO
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
@@ -168,8 +168,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE = RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -182,6 +182,8 @@ MAN_LINKS = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_XML = NO GENERATE_XML = NO
XML_OUTPUT = xml XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES XML_PROGRAMLISTING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output # configuration options for the AutoGen Definitions output
@@ -193,36 +195,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX = PERLMOD_MAKEVAR_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE} GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
MSCGEN_PATH = MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10 DOT_FONTSIZE = 10
DOT_FONTPATH = DOT_FONTPATH =
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES GROUP_GRAPHS = YES
@@ -235,8 +238,8 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50 DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0 MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES DOT_TRANSPARENT = YES
@@ -244,6 +247,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES GENERATE_LEGEND = YES
DOT_CLEANUP = YES DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to the search engine # Configuration::additions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE} SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -20,7 +20,6 @@ ELSE(ANDROID)
IF(DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgsimpleMDI)
ADD_SUBDIRECTORY(osg2cpp) ADD_SUBDIRECTORY(osg2cpp)
ADD_SUBDIRECTORY(osganalysis) ADD_SUBDIRECTORY(osganalysis)
ADD_SUBDIRECTORY(osganimate) ADD_SUBDIRECTORY(osganimate)
@@ -28,7 +27,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgautocapture) ADD_SUBDIRECTORY(osgautocapture)
ADD_SUBDIRECTORY(osgautotransform) ADD_SUBDIRECTORY(osgautotransform)
ADD_SUBDIRECTORY(osgbillboard) ADD_SUBDIRECTORY(osgbillboard)
ADD_SUBDIRECTORY(osgblenddrawbuffers)
ADD_SUBDIRECTORY(osgblendequation) ADD_SUBDIRECTORY(osgblendequation)
ADD_SUBDIRECTORY(osgcallback) ADD_SUBDIRECTORY(osgcallback)
ADD_SUBDIRECTORY(osgcamera) ADD_SUBDIRECTORY(osgcamera)
@@ -37,7 +35,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgcompositeviewer) ADD_SUBDIRECTORY(osgcompositeviewer)
ADD_SUBDIRECTORY(osgcopy) ADD_SUBDIRECTORY(osgcopy)
ADD_SUBDIRECTORY(osgcubemap) ADD_SUBDIRECTORY(osgcubemap)
ADD_SUBDIRECTORY(osgdeferred) ADD_SUBDIRECTORY(osgdelaunay)
ADD_SUBDIRECTORY(osgcluster) ADD_SUBDIRECTORY(osgcluster)
ADD_SUBDIRECTORY(osgdatabaserevisions) ADD_SUBDIRECTORY(osgdatabaserevisions)
ADD_SUBDIRECTORY(osgdepthpartition) ADD_SUBDIRECTORY(osgdepthpartition)
@@ -48,6 +46,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgfont) ADD_SUBDIRECTORY(osgfont)
ADD_SUBDIRECTORY(osgforest) ADD_SUBDIRECTORY(osgforest)
ADD_SUBDIRECTORY(osgfxbrowser) ADD_SUBDIRECTORY(osgfxbrowser)
ADD_SUBDIRECTORY(osgframerenderer)
ADD_SUBDIRECTORY(osgoutline) ADD_SUBDIRECTORY(osgoutline)
ADD_SUBDIRECTORY(osggameoflife) ADD_SUBDIRECTORY(osggameoflife)
ADD_SUBDIRECTORY(osggeometry) ADD_SUBDIRECTORY(osggeometry)
@@ -55,6 +54,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osghangglide) ADD_SUBDIRECTORY(osghangglide)
ADD_SUBDIRECTORY(osghud) ADD_SUBDIRECTORY(osghud)
ADD_SUBDIRECTORY(osgimagesequence) ADD_SUBDIRECTORY(osgimagesequence)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgintersection) ADD_SUBDIRECTORY(osgintersection)
ADD_SUBDIRECTORY(osgkdtree) ADD_SUBDIRECTORY(osgkdtree)
ADD_SUBDIRECTORY(osgkeyboard) ADD_SUBDIRECTORY(osgkeyboard)
@@ -65,11 +65,9 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osglightpoint) ADD_SUBDIRECTORY(osglightpoint)
ADD_SUBDIRECTORY(osglogicop) ADD_SUBDIRECTORY(osglogicop)
ADD_SUBDIRECTORY(osglogo) ADD_SUBDIRECTORY(osglogo)
ADD_SUBDIRECTORY(osggpucull)
ADD_SUBDIRECTORY(osggpx) ADD_SUBDIRECTORY(osggpx)
ADD_SUBDIRECTORY(osggraphicscost) ADD_SUBDIRECTORY(osggraphicscost)
ADD_SUBDIRECTORY(osgmanipulator) ADD_SUBDIRECTORY(osgmanipulator)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgmovie) ADD_SUBDIRECTORY(osgmovie)
ADD_SUBDIRECTORY(osgmultiplemovies) ADD_SUBDIRECTORY(osgmultiplemovies)
ADD_SUBDIRECTORY(osgmultiplerendertargets) ADD_SUBDIRECTORY(osgmultiplerendertargets)
@@ -77,7 +75,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgmultitexturecontrol) ADD_SUBDIRECTORY(osgmultitexturecontrol)
ADD_SUBDIRECTORY(osgmultitouch) ADD_SUBDIRECTORY(osgmultitouch)
ADD_SUBDIRECTORY(osgmultiviewpaging) ADD_SUBDIRECTORY(osgmultiviewpaging)
ADD_SUBDIRECTORY(osgobjectcache)
ADD_SUBDIRECTORY(osgoccluder) ADD_SUBDIRECTORY(osgoccluder)
ADD_SUBDIRECTORY(osgocclusionquery) ADD_SUBDIRECTORY(osgocclusionquery)
ADD_SUBDIRECTORY(osgoit) ADD_SUBDIRECTORY(osgoit)
@@ -98,16 +95,12 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgprerendercubemap) ADD_SUBDIRECTORY(osgprerendercubemap)
ADD_SUBDIRECTORY(osgreflect) ADD_SUBDIRECTORY(osgreflect)
ADD_SUBDIRECTORY(osgrobot) ADD_SUBDIRECTORY(osgrobot)
ADD_SUBDIRECTORY(osgSSBO)
ADD_SUBDIRECTORY(osgsampler)
ADD_SUBDIRECTORY(osgscalarbar) ADD_SUBDIRECTORY(osgscalarbar)
ADD_SUBDIRECTORY(osgscribe) ADD_SUBDIRECTORY(osgscribe)
ADD_SUBDIRECTORY(osgsequence) ADD_SUBDIRECTORY(osgsequence)
ADD_SUBDIRECTORY(osgshaders) ADD_SUBDIRECTORY(osgshaders)
ADD_SUBDIRECTORY(osgshaderpipeline)
ADD_SUBDIRECTORY(osgshadercomposition) ADD_SUBDIRECTORY(osgshadercomposition)
ADD_SUBDIRECTORY(osgshadergen) ADD_SUBDIRECTORY(osgshadergen)
ADD_SUBDIRECTORY(osgshadermultiviewport)
ADD_SUBDIRECTORY(osgshaderterrain) ADD_SUBDIRECTORY(osgshaderterrain)
# ADD_SUBDIRECTORY(osgshadercompositor) # ADD_SUBDIRECTORY(osgshadercompositor)
ADD_SUBDIRECTORY(osgshadow) ADD_SUBDIRECTORY(osgshadow)
@@ -125,17 +118,14 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgstereomatch) ADD_SUBDIRECTORY(osgstereomatch)
ADD_SUBDIRECTORY(osgterrain) ADD_SUBDIRECTORY(osgterrain)
ADD_SUBDIRECTORY(osgthreadedterrain) ADD_SUBDIRECTORY(osgthreadedterrain)
ADD_SUBDIRECTORY(osgtransferfunction)
ADD_SUBDIRECTORY(osgtext) ADD_SUBDIRECTORY(osgtext)
ADD_SUBDIRECTORY(osgtext3D) ADD_SUBDIRECTORY(osgtext3D)
ADD_SUBDIRECTORY(osgtexture1D) ADD_SUBDIRECTORY(osgtexture1D)
ADD_SUBDIRECTORY(osgtexture2D) ADD_SUBDIRECTORY(osgtexture2D)
ADD_SUBDIRECTORY(osgtexture2DArray)
ADD_SUBDIRECTORY(osgtexture3D) ADD_SUBDIRECTORY(osgtexture3D)
ADD_SUBDIRECTORY(osgtexturerectangle) ADD_SUBDIRECTORY(osgtexturerectangle)
ADD_SUBDIRECTORY(osgtexturecompression) ADD_SUBDIRECTORY(osgtexturecompression)
ADD_SUBDIRECTORY(osgthirdpersonview) ADD_SUBDIRECTORY(osgthirdpersonview)
ADD_SUBDIRECTORY(osgtransformfeedback)
ADD_SUBDIRECTORY(osguniformbuffer) ADD_SUBDIRECTORY(osguniformbuffer)
ADD_SUBDIRECTORY(osguserstats) ADD_SUBDIRECTORY(osguserstats)
ADD_SUBDIRECTORY(osgvertexprogram) ADD_SUBDIRECTORY(osgvertexprogram)
@@ -168,9 +158,10 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgwidgettable) ADD_SUBDIRECTORY(osgwidgettable)
ADD_SUBDIRECTORY(osgwidgetwindow) ADD_SUBDIRECTORY(osgwidgetwindow)
ADD_SUBDIRECTORY(osguserdata) ADD_SUBDIRECTORY(osguserdata)
# GL3/GL4 example # GL3/GL4 example
ADD_SUBDIRECTORY(osgsimplegl3) ADD_SUBDIRECTORY(osgsimplegl3)
ADD_SUBDIRECTORY(osgbindlesstext)
IF(OSG_CPP_EXCEPTIONS_AVAILABLE) IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
ADD_SUBDIRECTORY(osgunittests) ADD_SUBDIRECTORY(osgunittests)
ADD_SUBDIRECTORY(osgmemorytest) ADD_SUBDIRECTORY(osgmemorytest)
@@ -193,6 +184,10 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgpdf) ADD_SUBDIRECTORY(osgpdf)
IF (GLUT_FOUND)
ADD_SUBDIRECTORY(osgviewerGLUT)
ENDIF(GLUT_FOUND)
IF (SDL_FOUND) IF (SDL_FOUND)
ADD_SUBDIRECTORY(osgviewerSDL) ADD_SUBDIRECTORY(osgviewerSDL)
ENDIF(SDL_FOUND) ENDIF(SDL_FOUND)
@@ -211,6 +206,20 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF ( (QT4_FOUND OR Qt5Widgets_FOUND) AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
IF ( QT4_FOUND OR Qt5Widgets_FOUND)
ADD_SUBDIRECTORY(osgviewerQt)
ADD_SUBDIRECTORY(osgqfont)
ENDIF()
IF ( (QT4_FOUND AND QT_QTWEBKIT_FOUND) OR Qt5WebKitWidgets_FOUND )
ADD_SUBDIRECTORY(osgQtWidgets)
ADD_SUBDIRECTORY(osgQtBrowser)
ENDIF()
ENDIF()
IF (FLTK_FOUND AND FLTK_GL_LIBRARY) IF (FLTK_FOUND AND FLTK_GL_LIBRARY)
ADD_SUBDIRECTORY(osgviewerFLTK) ADD_SUBDIRECTORY(osgviewerFLTK)
ENDIF() ENDIF()
@@ -254,3 +263,4 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF(ANDROID) ENDIF(ANDROID)

View File

@@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
// Search in str for all occurrences of spat and replace them with rpat. // Search in str for all occurences of spat and replace them with rpat.
void searchAndReplace(std::string& str, const std::string& spat, const std::string& rpat) void searchAndReplace(std::string& str, const std::string& spat, const std::string& rpat)
{ {
std::string::size_type pos = 0; std::string::size_type pos = 0;
@@ -30,13 +30,13 @@ void writeShader(osg::Shader* shader, const std::string& cppFileName, const std:
searchAndReplace(shaderSource, "\r\n", "\n"); searchAndReplace(shaderSource, "\r\n", "\n");
searchAndReplace(shaderSource, "\r", "\n"); searchAndReplace(shaderSource, "\r", "\n");
searchAndReplace(shaderSource, "\"", "\\\""); searchAndReplace(shaderSource, "\"", "\\\"");
std::string variableString = std::string("char ")+variableName+std::string("[] = "); std::string variableString = std::string("char ")+variableName+std::string("[] = ");
std::string::size_type startOfLine = 0; std::string::size_type startOfLine = 0;
std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine); std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine);
if (endOfLine==std::string::npos) if (endOfLine==std::string::npos)
{ {
fout<<variableString<<shaderSource<<"\\n\";"<<std::endl; fout<<variableString<<shaderSource<<"\\n\";"<<std::endl;
} }
@@ -63,29 +63,25 @@ int main( int argc, char **argv )
{ {
// use an ArgumentParser object to manage the program arguments. // use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program. // set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting glsl shader files into char arrays that can be compiled into applications."); arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting glsl shader files into char arrays that can be compiled into applications.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for."); arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
arguments.getApplicationUsage()->addCommandLineOption("--write-to-source-file-directory","Use the path to the source filename as the directory to write to.");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
// if user request help write it out to cout. // if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help")) if (arguments.read("-h") || arguments.read("--help"))
{ {
arguments.getApplicationUsage()->write(std::cout); arguments.getApplicationUsage()->write(std::cout);
return 1; return 1;
} }
bool useSamePathAsSourceFile = false;
if (arguments.read("--write-to-source-file-directory")) useSamePathAsSourceFile = true;
std::string filename; std::string filename;
if (arguments.read("--shader",filename)) if (arguments.read("--shader",filename))
{ {
osg::ref_ptr<osg::Shader> shader = osgDB::readRefShaderFile(filename); osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename);
if (shader.valid()) if (shader.valid())
{ {
std::string name = osgDB::getStrippedName(filename); std::string name = osgDB::getStrippedName(filename);
@@ -98,11 +94,9 @@ int main( int argc, char **argv )
name[pos] = '_'; name[pos] = '_';
pos = name.find_first_of(invalidCharacters); pos = name.find_first_of(invalidCharacters);
} }
std::string ext = osgDB::getFileExtension(filename); std::string ext = osgDB::getFileExtension(filename);
std::string cppFileName = name + "_" + ext + ".cpp"; std::string cppFileName = osgDB::concatPaths(path, name + "_" + ext + ".cpp");
if (useSamePathAsSourceFile) cppFileName = osgDB::concatPaths(path, cppFileName);
std::string variableName = name + "_" + ext; std::string variableName = name + "_" + ext;
writeShader(shader.get(), cppFileName, variableName); writeShader(shader.get(), cppFileName, variableName);
@@ -113,7 +107,7 @@ int main( int argc, char **argv )
std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl; std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl;
return 1; return 1;
} }
} }
std::cout<<"No appropriate command line options used."<<std::endl; std::cout<<"No appropriate command line options used."<<std::endl;

View File

@@ -5,7 +5,7 @@
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk> <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requirements (1.1) --> <uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requierements (1.1) -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg"> <application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i]; newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl; osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename); osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) { if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl; osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else { } else {

View File

@@ -5,7 +5,7 @@
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk> <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requirements (2.0) --> <uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requierements (2.0) -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg"> <application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i]; newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl; osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename); osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) { if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl; osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else { } else {

View File

@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 2.6)
SET(PROJECT_NAME osgCMakeExample)
PROJECT(${PROJECT_NAME})
FIND_PACKAGE(OpenThreads)
FIND_PACKAGE(osg)
FIND_PACKAGE(osgDB)
FIND_PACKAGE(osgUtil)
FIND_PACKAGE(osgGA)
FIND_PACKAGE(osgViewer)
SET(SOURCES
main.cpp
)
INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR} ${OSG_INCLUDE_DIR})
LINK_DIRECTORIES(${OSG_LIB_DIR})
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OSG_LIBRARIES} ${OSGVIEWER_LIBRARIES} ${OSGUTIL_LIBRARIES} ${OSGDB_LIBRARIES} ${OSGGA_LIBRARIES} ${OPENTHREADS_LIBRARIES})

View File

@@ -1,183 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/StateSetManipulator>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/SphericalManipulator>
#include <osgGA/Device>
#include <iostream>
int main(int argc, char** argv)
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
osgViewer::Viewer viewer(arguments);
unsigned int helpType = 0;
if ((helpType = arguments.readHelpType()))
{
arguments.getApplicationUsage()->write(std::cout, helpType);
return 1;
}
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
std::string device;
while(arguments.read("--device", device))
{
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid())
{
viewer.addDevice(dev);
}
}
// set up the camera manipulators.
{
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
keyswitchManipulator->addMatrixManipulator( '5', "Orbit", new osgGA::OrbitManipulator() );
keyswitchManipulator->addMatrixManipulator( '6', "FirstPerson", new osgGA::FirstPersonManipulator() );
keyswitchManipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() );
std::string pathfile;
double animationSpeed = 1.0;
while(arguments.read("--speed",animationSpeed) ) {}
char keyForAnimationPath = '8';
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid())
{
apm->setTimeScale(animationSpeed);
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
keyswitchManipulator->selectMatrixManipulator(num);
++keyForAnimationPath;
}
}
viewer.setCameraManipulator( keyswitchManipulator.get() );
}
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler);
// add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add the help handler
viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
// add the record camera path handler
viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);
// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
// optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel);
viewer.setSceneData(loadedModel);
viewer.realize();
return viewer.run();
}

View File

@@ -0,0 +1,25 @@
SET(TARGET_SRC
osgQtBrowser.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
if ( QT4_FOUND )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
endif( QT4_FOUND )
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SET ( EXAMPLE_NAME osgQtBrowser )
SETUP_EXAMPLE(${EXAMPLE_NAME})
IF ( Qt5Widgets_FOUND )
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL WebKitWidgets )
ENDIF( Qt5Widgets_FOUND )

View File

@@ -0,0 +1,145 @@
/* OpenSceneGraph example, osgcompositeviewer.
*
* 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 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.
*/
#include <iostream>
#include <osg/Notify>
#include <osg/io_utils>
#include <osg/ArgumentParser>
#include <osgDB/WriteFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgWidget/Browser>
#include <QtGlobal>
#if QT_VERSION >= 0x050000
# include <QtWebKitWidgets>
#else
# include <QtWebKit>
#endif
#include <QWebSettings>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QApplication>
#include <QPainter>
#include <QtEvents>
#include <osgQt/QGraphicsViewAdapter>
#include <osgQt/QWebViewImage>
// Thread that runs the viewer's frame loop as we can't run Qt in the background...
class ViewerFrameThread : public OpenThreads::Thread
{
public:
ViewerFrameThread(osgViewer::ViewerBase* viewerBase, bool doQApplicationExit):
_viewerBase(viewerBase),
_doQApplicationExit(doQApplicationExit) {}
~ViewerFrameThread()
{
cancel();
while(isRunning())
{
OpenThreads::Thread::YieldCurrentThread();
}
}
int cancel()
{
_viewerBase->setDone(true);
return 0;
}
void run()
{
int result = _viewerBase->run();
if (_doQApplicationExit) QApplication::exit(result);
}
osg::ref_ptr<osgViewer::ViewerBase> _viewerBase;
bool _doQApplicationExit;
};
int main(int argc, char **argv)
{
// Qt requires that we construct the global QApplication before creating any widgets.
QApplication app(argc, argv);
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
bool useFrameLoopThread = false;
if (arguments.read("--no-frame-thread")) useFrameLoopThread = false;
if (arguments.read("--frame-thread")) useFrameLoopThread = true;
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage;
if (arguments.argc()>1) image->navigateTo((arguments[1]));
else image->navigateTo("http://www.youtube.com/");
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
osg::Vec3(1.0f,0.0f,0.0f),
osg::Vec3(0.0f,0.0f,1.0f),
osg::Vec4(1.0f,1.0f,1.0f,1.0f),
osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
browser->assign(image.get(), hints);
// image->focusBrowser(true);
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer(arguments);
viewer->setSceneData(browser.get());
viewer->setCameraManipulator(new osgGA::TrackballManipulator());
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->addEventHandler(new osgViewer::WindowSizeHandler);
if (useFrameLoopThread)
{
// create a thread to run the viewer's frame loop
ViewerFrameThread viewerThread(viewer.get(), true);
viewerThread.startThread();
// now start the standard Qt event loop, then exists when the viewerThead sends the QApplication::exit() signal.
return QApplication::exec();
}
else
{
// run the frame loop, interleaving Qt and the main OSG frame loop
while(!viewer->done())
{
// process Qt events - this handles both events and paints the browser image
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
viewer->frame();
}
return 0;
}
}

View File

@@ -0,0 +1,23 @@
SET(TARGET_SRC
osgQtWidgets.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
if ( QT4_FOUND )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
endif( QT4_FOUND )
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SET ( EXAMPLE_NAME osgQtWidgets )
SETUP_EXAMPLE(${EXAMPLE_NAME})
IF ( Qt5Widgets_FOUND )
qt5_use_modules( example_${EXAMPLE_NAME} OpenGL WebKitWidgets )
ENDIF( Qt5Widgets_FOUND )

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
SET(TARGET_SRC osgSSBO.cpp )
SETUP_EXAMPLE(osgSSBO)

View File

@@ -1,946 +0,0 @@
//info : osgSSBO example,testing ShaderStorageBufferObjects ,Markus Hein, 2014, osg-3.2.1
//required hardware and driver must support GL >= GL 4.3 or GL ES 3.1 (GL ES not tested, would be nice if someone will test it on a small device)
//testing osg support for Shader Storage Buffer Objects
//version: "first take" from last night session..
#include <osg/StateAttributeCallback>
#include <osg/Texture2D>
#include <osg/Geometry>
#include <osg/DispatchCompute>
#include <osgDB/ReadFile>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osg/Node>
#include <osg/PositionAttitudeTransform>
#include <osg/Geometry>
#include <osg/Notify>
#include <osg/MatrixTransform>
#include <osg/Texture2D>
#include <osg/TextureRectangle>
#include <osg/Stencil>
#include <osg/Depth>
#include <osg/Billboard>
#include <osg/Material>
#include <osg/AnimationPath>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgUtil/SmoothingVisitor>
#include <osgDB/Registry>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/Renderer>
#include <osg/Array>
#include <osg/BoundingSphere>
#include <osg/BufferIndexBinding>
#include <osg/BufferObject>
#include <osg/Group>
#include <osg/Math>
#include <osg/MatrixTransform>
#include <osg/Program>
#include <osg/Shader>
#include <osg/Drawable>
#include <osg/CopyOp>
#include <osg/State>
#include <osg/Matrix>
#include <osg/ShapeDrawable>
#include <osg/GL>
#include <osg/StateSet>
#include <osg/Texture2D>
#include <osg/BlendFunc>
#include <osg/TexEnv>
#include <osg/Material>
#include <osg/PointSprite>
#include <osg/Program>
#include <osg/Notify>
#include <osg/Point>
#include <osg/io_utils>
#include <osg/VertexProgram>
#include <osgText/Font>
#include <osgText/Text>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileNameUtils>
#include <osgUtil/Optimizer>
#include <iostream>
#include <typeinfo>
using namespace osg;
//todo .. #define COMPUTATION_IN_SEPARATE_THREAD
#define WORK_GROUP_SIZE 16
#define PRERENDER_ANTIALIASINGMULTISAMPLES 16
#define PRERENDER_HIGH_QUALITY_ANTIALIASING
#define PRERENDER_WIDTH 1920
#define PRERENDER_HEIGHT 1080
#define SUB_PLACEMENT_OFFSET_HORIZONTAL 0.5
#define SUB_PLACEMENT_OFFSET_VERTICAL 0.5
enum BufferOffset
{
POSITION_NOW_OFFSET,
POSITION_OLD_OFFSET,
POSITION_INIT_OFFSET,
VELOCITY_NOW_OFFSET,
VELOCITY_OLD_OFFSET,
VELOCITY_INIT_OFFSET,
ACCELERATION_OFFSET,
PROPERTIES_OFFSET,
OFFSET_END
};
const int __numDataValuesPerChannel = OFFSET_END;
const int __numChannels = 4;
//512x512x4x7 = 7.340.032 floats in SSBO on GPU
const int NUM_ELEMENTS_X = 512;
const int NUM_ELEMENTS_Y = 512;
float random(float min, float max) { return min + (max - min)*(float)rand() / (float)RAND_MAX; }
enum Channel
{
RED_CHANNEL,
GREEN_CHANNEL,
BLUE_CHANNEL,
ALPHA_CHANNEL,
RGB_CHANNEL,
RGBA_CHANNEL
};
class ShaderStorageBufferCallback : public osg::StateAttributeCallback
{
public:
void operator() (osg::StateAttribute* /*attr*/, osg::NodeVisitor* /*nv*/)
{
//if you need to process the data in your app-code , better leaving it on GPU and processing there, uploading per frame will make it slow
#if 0
osg::ShaderStorageBufferBinding* ssbb = static_cast<osg::ShaderStorageBufferBinding*>(attr);
osg::ShaderStorageBufferObject* ssbo
= static_cast<osg::ShaderStorageBufferObject*>(ssbb->getBufferObject());
osg::FloatArray* array = static_cast<osg::FloatArray*>(ssbo->getBufferData(0));
float someValue = array->at(0);
//std::cout << "someValue now: " << someValue << std::endl;
//data transfer performance test
// array->dirty();
#endif
}
};
//do not forget to set OSG_FILE_PATH to default OSG-Data and make sure the new shaders are copied there under"shaders"
class ComputeNode : public osg::PositionAttitudeTransform
{
public:
osg::ref_ptr<osg::DispatchCompute> _DispatchCompute;
osg::ref_ptr<osg::Program> _computeProgram;
osg::ref_ptr<osg::Shader> _computeShader; //compute and write position data in SSBO
osg::ref_ptr<osg::Shader> _vertexShader; //reading position data from SSBO (OBS!: make sure glMemoryBuffer() is syncing this)
osg::ref_ptr<osg::Shader> _geometryShader; //building a quad looking to the camera
osg::ref_ptr<osg::Shader> _fragmentShader; //use false-colors etc. for making your data visible
osg::ref_ptr<osg::Node> _helperNode; // coordinate system node
ref_ptr<osg::ShaderStorageBufferObject> _ssbo;
ref_ptr<osg::ShaderStorageBufferBinding> _ssbb;
GLfloat* _data; // some data we upload to GPU, initialised with random values
osg::ref_ptr<FloatArray> _dataArray; //
osg::ref_ptr<osg::Group> _computationResultsRenderGroup;
osg::ref_ptr<osg::Program> _computationResultsRenderProgram;
osg::ref_ptr<osg::StateSet> _computationResultsRenderStateSet;
std::string _computeShaderSourcePath;
std::string _vertexShaderSourcePath;
std::string _geometryShaderSourcePath;
std::string _fragmentShaderSourcePath;
void addHelperGeometry();
void addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacement, float scale, Channel channel, BufferOffset shaderBufferOffset, std::string labelcaption, float minDataRange, float maxDataRange);
void addComputationResultsRenderTree();
void initComputingSetup();
ComputeNode()
{
_computeShaderSourcePath = "shaders/osgssboComputeShader.cs";
_vertexShaderSourcePath = "shaders/osgssboVertexShader.vs";
_geometryShaderSourcePath = "shaders/osgssboGeometryShader.gs";
_fragmentShaderSourcePath = "shaders/osgssboFragmentShader.fs";
_DispatchCompute=new osg::DispatchCompute();
addChild(_DispatchCompute);
}
};
class ComputeNodeUpdateCallback : public osg::NodeCallback
{
public:
ComputeNode* _computeNode;
osg::Timer_t _prevShaderUpdateTime;
osg::Timer _timer;
ComputeNodeUpdateCallback(){}
ComputeNodeUpdateCallback(ComputeNode* computeNode)
{
_computeNode = computeNode;
_prevShaderUpdateTime = 0;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
osg::Timer_t currTime = _timer.tick();
if (_timer.delta_s(_prevShaderUpdateTime, currTime) > 1.0) //one second interval for shader-changed-do-reload check
{
osg::ref_ptr<osg::Shader> reloadedshader;
std::string runningSource;
std::string reloadedstring;
if (_computeNode->_computeShader.valid())
{
runningSource = _computeNode->_computeShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeNode->_computeShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
{
_computeNode->_computeProgram->removeShader(_computeNode->_computeShader.get());
_computeNode->_computeShader = reloadedshader.get();
_computeNode->_computeProgram->addShader(_computeNode->_computeShader.get());
}
}
if (_computeNode->_vertexShader.valid())
{
runningSource = _computeNode->_vertexShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::VERTEX, _computeNode->_vertexShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
{
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_vertexShader.get());
_computeNode->_vertexShader = reloadedshader.get();
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_vertexShader.get());
}
}
if (_computeNode->_geometryShader.valid())
{
runningSource = _computeNode->_geometryShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::GEOMETRY, _computeNode->_geometryShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
{
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_geometryShader.get());
_computeNode->_geometryShader = reloadedshader.get();
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_geometryShader.get());
}
}
if (_computeNode->_fragmentShader.valid())
{
runningSource = _computeNode->_fragmentShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, _computeNode->_fragmentShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
{
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_fragmentShader.get());
_computeNode->_fragmentShader = reloadedshader.get();
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_fragmentShader.get());
}
}
_prevShaderUpdateTime = _timer.tick();
}
traverse(node, nv);
}
};
//set OSG_FILE_PATH for loading axes.osgt
void ComputeNode::addHelperGeometry()
{
_helperNode = osgDB::readRefNodeFile("axes.osgt");
if (_helperNode.valid())
{
addChild(_helperNode.get());
}
//osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
//pat->setPosition(osg::Vec3(0.5, 0, 0.5));
//osg::Geode *sphereGeode = new osg::Geode;
//float radius = 0.5f;
//osg::TessellationHints* hints = new osg::TessellationHints;
//hints->setDetailRatio(0.9f);
//osg::ShapeDrawable* sphere = new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), radius), hints);
//sphereGeode->addDrawable(sphere);
//sphere->setColor(osg::Vec4(0, 1, 0, 0.1));
//osg::StateSet* stateset = sphereGeode->getOrCreateStateSet();
//osg::BlendFunc *blend = new osg::BlendFunc;
//blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
//stateset->setAttributeAndModes(blend, osg::StateAttribute::ON);
//pat->addChild(sphereGeode);
//addChild(pat);
}
void ComputeNode::addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacement, float scale, Channel colorchannel, BufferOffset shaderStorageBufferOffset, std::string labelCaption, float minDataRange, float maxDataRange)
{
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
pat->setPosition(relativePlacement);
addChild(pat);
osg::Geometry* geom;
if (NUM_ELEMENTS_X >= NUM_ELEMENTS_Y)
{
float ratio = (float)((float)NUM_ELEMENTS_Y / (float)NUM_ELEMENTS_X);
geom = osg::createTexturedQuadGeometry(placement, osg::Vec3(1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f, ratio*1.0f*scale));
}
else
{
float ratio = (float)((float)NUM_ELEMENTS_X / (float)NUM_ELEMENTS_Y);
geom = osg::createTexturedQuadGeometry(placement, osg::Vec3(ratio*1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f, 1.0f*scale));
}
geom->setVertexAttribArray(1, geom->getTexCoordArray(0), osg::Array::BIND_PER_VERTEX);
osg::ref_ptr<osg::Geode> quad = new osg::Geode;
quad->addDrawable(geom);
quad->setStateSet(getOrCreateStateSet());
pat->addChild(quad.get());
static const char* vertexShaderSrcChannelMonitor = {
"#version 430 \n"
"uniform int numRows;\n"
"uniform int numCols;\n"
"uniform float osg_FrameTime;\n"
"uniform mat4 osg_ProjectionMatrix;\n"
"uniform mat4 osg_ModelViewMatrix;\n"
"out vec2 texCoordFromVertexShader;\n"
"struct particle{ float x; float y; float z; float w;};"
"layout (location = 0) in vec3 vertexpos;\n"
"attribute vec2 tex_coords;\n"
"void main() {\n"
"texCoordFromVertexShader.xy = tex_coords.xy; gl_Position = ( osg_ProjectionMatrix * osg_ModelViewMatrix * vec4(vertexpos.x,vertexpos.y,vertexpos.z,1) ); \n"
"}\n"
};
std::stringstream fragmentshaderstringstreamChannelMonitor;
fragmentshaderstringstreamChannelMonitor << "#version 430\n";
fragmentshaderstringstreamChannelMonitor << "uniform int numRows;\n";
fragmentshaderstringstreamChannelMonitor << "uniform int numCols;\n";
fragmentshaderstringstreamChannelMonitor << "uniform float dataRangeMin;\n";
fragmentshaderstringstreamChannelMonitor << "uniform float dataRangeMax;\n";
fragmentshaderstringstreamChannelMonitor << "in vec2 texCoordFromVertexShader;\n";
fragmentshaderstringstreamChannelMonitor << "struct particle{ float x; float y; float z; float w;};";
fragmentshaderstringstreamChannelMonitor << "layout(std140, binding=0) coherent buffer particles{particle p[];}; ";
fragmentshaderstringstreamChannelMonitor << "\n";
fragmentshaderstringstreamChannelMonitor << "void main(void)\n";
fragmentshaderstringstreamChannelMonitor << "{\n";
fragmentshaderstringstreamChannelMonitor << "ivec2 storePos = ivec2(numRows*texCoordFromVertexShader.x, numCols*texCoordFromVertexShader.y); particle particleData = p[" << shaderStorageBufferOffset * NUM_ELEMENTS_X*NUM_ELEMENTS_Y << " + (storePos.x*numRows + storePos.y)]; ";
//fragmentshaderstringstreamChannelMonitor << " memoryBarrierBuffer(); \n";
fragmentshaderstringstreamChannelMonitor << " float dataRangeMultiplier = 1.0 / abs(dataRangeMax - dataRangeMin); \n";
switch (colorchannel)
{
case RED_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y =0.0; color.z = 0.0; color.w = 1.0; gl_FragColor = color;\n";
break;
}
case GREEN_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.0; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.0; color.w = 1.0; gl_FragColor = color;\n";
break;
}
case BLUE_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.0; color.y = 0.0; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 0.0 ; gl_FragColor = color;\n";
break;
}
case ALPHA_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.w; color.y = 0.5+dataRangeMultiplier*particleData.w; color.z = 0.5+dataRangeMultiplier*particleData.w; color.w = 0.5+0.5*particleData.w; gl_FragColor = color;\n";
break;
}
case RGB_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 1.0; gl_FragColor = color;\n";
break;
}
case RGBA_CHANNEL:
{
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 0.5+0.5*particleData.w; gl_FragColor = color;\n";
break;
}
}
fragmentshaderstringstreamChannelMonitor << "}\n";
osg::Program * program = new osg::Program;
program->addShader(new osg::Shader(osg::Shader::VERTEX, vertexShaderSrcChannelMonitor));
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, fragmentshaderstringstreamChannelMonitor.str().c_str()));
program->addBindAttribLocation("tex_coords", 1);
osg::StateSet* ss = geom->getOrCreateStateSet();
ss->setAttributeAndModes(program, osg::StateAttribute::ON);
ss->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_X));
ss->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_Y));
ss->addUniform(new osg::Uniform("dataRangeMin", (float)minDataRange));
ss->addUniform(new osg::Uniform("dataRangeMax", (float)maxDataRange));
ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
//add a label
osg::ref_ptr<osgText::Text> text = new osgText::Text;
osg::ref_ptr<osgText::Font> font = osgText::readRefFontFile("fonts/arial.ttf");
text->setFont(font);
text->setColor(osg::Vec4(1, 1, 1, 1));
text->setCharacterSize(0.1*scale);
text->setPosition(placement + osg::Vec3(0.05, 0.05, 0));
pat->setName(labelCaption);
text->setText(pat->getName());
text->setBackdropType(osgText::Text::OUTLINE);
text->setBackdropOffset(0.05f);
text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
quad->addDrawable(text);
pat->addChild(quad.get());
}
//compute texture image , taken from osgspotlight
osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4& backgroudColour, unsigned int size, float power)
{
osg::Image* image = new osg::Image;
image->allocateImage(size, size, 1,
GL_RGBA, GL_UNSIGNED_BYTE);
float mid = (float(size) - 1)*0.5f;
float div = 2.0f / float(size);
for (unsigned int r = 0; r < size; ++r)
{
unsigned char* ptr = image->data(0, r, 0);
for (unsigned int c = 0; c < size; ++c)
{
float dx = (float(c) - mid)*div;
float dy = (float(r) - mid)*div;
float pr = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
if (pr < 0.0f) pr = 0.0f;
osg::Vec4 color = centerColour*pr + backgroudColour*(1.0f - pr);
*ptr++ = (unsigned char)((color[0])*255.0f);
*ptr++ = (unsigned char)((color[1])*255.0f);
*ptr++ = (unsigned char)((color[2])*255.0f);
*ptr++ = (unsigned char)((color[3])*255.0f);
}
}
return image;
}
void ComputeNode::addComputationResultsRenderTree()
{
_computationResultsRenderProgram = new osg::Program;
_vertexShader = osgDB::readRefShaderFile(osg::Shader::VERTEX, _vertexShaderSourcePath);
_computationResultsRenderProgram->addShader(_vertexShader.get());
_geometryShader = osgDB::readRefShaderFile(osg::Shader::GEOMETRY, _geometryShaderSourcePath);
_computationResultsRenderProgram->addShader(_geometryShader.get());
_fragmentShader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, _fragmentShaderSourcePath);
_computationResultsRenderProgram->addShader(_fragmentShader.get());
_computationResultsRenderProgram->addBindAttribLocation("tex_coords", 1);
_computationResultsRenderGroup = new osg::Group;
_computationResultsRenderGroup->setDataVariance(osg::Object::DYNAMIC);
_computationResultsRenderStateSet = _computationResultsRenderGroup->getOrCreateStateSet();
_computationResultsRenderStateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
osg::PointSprite *sprite = new osg::PointSprite;
int texture_unit = 0;
_computationResultsRenderStateSet->setTextureAttributeAndModes(texture_unit, sprite, osg::StateAttribute::ON);
_computationResultsRenderStateSet->setAttributeAndModes(_computationResultsRenderProgram.get(), osg::StateAttribute::ON);
_computationResultsRenderStateSet->addUniform(new osg::Uniform("particleTexture", texture_unit));
_computationResultsRenderStateSet->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_X));
_computationResultsRenderStateSet->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_Y));
_computationResultsRenderStateSet->setMode(GL_POINT_SMOOTH, osg::StateAttribute::ON);
_computationResultsRenderStateSet->setMode(GL_VERTEX_PROGRAM_POINT_SIZE_ARB, osg::StateAttribute::ON);
_computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
_computationResultsRenderStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
osg::Texture2D *tex = new osg::Texture2D();
osg::Image* particleImage = createSpotLightImage(osg::Vec4(1, 0, 0, 1), osg::Vec4(0.5, 0, 0, 0.0), 32, 0.7);
if (particleImage)
{
tex->setImage(particleImage);
}
_computationResultsRenderStateSet->setTextureAttributeAndModes(texture_unit, tex, osg::StateAttribute::ON);
osg::BlendFunc *blend = new osg::BlendFunc;
if (false) //emissive particles
{
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE);
}
else
{
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
}
_computationResultsRenderStateSet->setAttributeAndModes(blend, osg::StateAttribute::ON);
osg::Depth* depth = new osg::Depth;
depth->setRange(0.0f, 0.0f);
depth->setFunction(osg::Depth::ALWAYS);
depth->setWriteMask(false);
depth->setFunction(osg::Depth::ALWAYS);
_computationResultsRenderStateSet->setAttributeAndModes(depth, osg::StateAttribute::OFF);
osg::Geode* particleGeode = new osg::Geode;
unsigned int numVertices = NUM_ELEMENTS_X*NUM_ELEMENTS_Y;
osg::Geometry* particleGeometry = new osg::Geometry;
particleGeometry->setUseDisplayList(false);
particleGeometry->setUseVertexBufferObjects(true);
osg::Vec3Array* vertexarray = new osg::Vec3Array;
osg::Vec2Array* tcoords = new osg::Vec2Array;
osg::Vec2 bottom_texcoord(0.0f, 0.0f);
osg::Vec2 dx_texcoord(1.0f / (float)(NUM_ELEMENTS_X), 0.0f);
osg::Vec2 dy_texcoord(0.0f, 1.0f / (float)(NUM_ELEMENTS_Y));
for (int i = 0; i < NUM_ELEMENTS_X; i++)
{
osg::Vec2 texcoord = bottom_texcoord + dy_texcoord*(float)i;
for (int j = 0; j < NUM_ELEMENTS_Y; j++)
{
vertexarray->push_back(osg::Vec3(texcoord.x(), texcoord.y(), 0.0));
tcoords->push_back(osg::Vec2(texcoord.x(), texcoord.y()));
texcoord += dx_texcoord;
}
}
particleGeometry->setVertexArray(vertexarray);
particleGeometry->addPrimitiveSet(new osg::DrawArrays(GL_POINTS, 0, numVertices));
particleGeometry->setTexCoordArray(0, tcoords);
//this glMemoryBarrier thing... not sure if we could better do instanced drawing? all the data is in Shader Storage Buffer..
particleGeometry->setVertexAttribArray(1, particleGeometry->getTexCoordArray(0), osg::Array::BIND_PER_VERTEX);
_computationResultsRenderGroup->addChild(particleGeode);
particleGeode->addDrawable(particleGeometry);
addChild(_computationResultsRenderGroup.get());
}
void ComputeNode::initComputingSetup()
{
_computeProgram = new osg::Program;
_DispatchCompute->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
_computeShader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath);
_computeProgram->addShader(_computeShader.get());
setDataVariance(osg::Object::DYNAMIC);
osg::StateSet* statesetComputation = getOrCreateStateSet();
statesetComputation->setAttributeAndModes(_computeProgram.get());
statesetComputation->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_X));
statesetComputation->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_Y));
statesetComputation->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
//blocksize
int numParticles = NUM_ELEMENTS_X * NUM_ELEMENTS_Y;
const unsigned blockSize = numParticles * __numChannels * __numDataValuesPerChannel* sizeof(GLfloat);
//init all the particle data array
int idx = 0;
_data = new GLfloat[NUM_ELEMENTS_X * NUM_ELEMENTS_Y * __numChannels * __numDataValuesPerChannel];
_dataArray = new FloatArray;
//init the data array somehow, this way all is stored in one BufferObject. maybe better using multiple buffers instead? not sure what is faster and better for threading
for (int d = 0; d < __numDataValuesPerChannel; ++d)
{
for (int i = 0; i < NUM_ELEMENTS_X; ++i)
{
for (int j = 0; j < NUM_ELEMENTS_Y; ++j)
{
for (int k = 0; k < __numChannels; ++k)
{
switch (k)
{
case (RED_CHANNEL) :
{
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
{
*_data = random(0.25, 0.75);
}
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
{
*_data = random(-2.4, 2.4);
}
if (d == ACCELERATION_OFFSET) //acceleration
{
*_data = random(-3.0, 3.0);
}
if (d == PROPERTIES_OFFSET) //property particle mass (compute shader is computing sphere mass from radius instead)
{
*_data = random(0.2, 15.0);
}
break;
}
case (GREEN_CHANNEL) :
{
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
{
*_data = random(0.25, 0.75);
}
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
{
*_data = random(-2.4, 2.4);
}
if (d == ACCELERATION_OFFSET)//acceleration
{
*_data = random(-3.0, 3.0);
}
if (d == PROPERTIES_OFFSET) //property particle radius
{
*_data = random(0.07, 0.219);
}
break;
}
case (BLUE_CHANNEL) :
{
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
{
*_data = random(0.25, 0.75);
}
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
{
*_data = random(-2.4, 2.4);
}
if (d == ACCELERATION_OFFSET)//acceleration
{
*_data = random(-3.0, 3.0);
}
if (d == PROPERTIES_OFFSET) //place for some other property
{
*_data = random(0.0, 0.0);
}
break;
}
case (ALPHA_CHANNEL) :
{
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
{
*_data = random(1.0, 1.0);
}
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
{
*_data = random(-2.4, 2.4);
}
if (d == ACCELERATION_OFFSET) //acceleration
{
//*_data = random(1.0, 1.0);
*_data = random(0.0, 0.0);
}
if (d == PROPERTIES_OFFSET) //place for some other property
{
*_data = random(0.3, 0.3);
}
break;
}
}
_dataArray->push_back(*_data);
_data++;
idx++;
}
}
}
}
_ssbo = new osg::ShaderStorageBufferObject;
_dataArray->setBufferObject(_ssbo.get());
_ssbb = new osg::ShaderStorageBufferBinding(0, _dataArray.get(), 0, blockSize);
statesetComputation->setAttributeAndModes(_ssbb.get(), osg::StateAttribute::ON);
//option, do something useful with data or test the transfer speed
//_ssbb->setUpdateCallback(new ShaderStorageBufferCallback);
//adding a quad , visualizing data in buffer
addDataMonitor(osg::Vec3(0, -1, 0), osg::Vec3(SUB_PLACEMENT_OFFSET_HORIZONTAL * 0, -SUB_PLACEMENT_OFFSET_VERTICAL * -2.0, SUB_PLACEMENT_OFFSET_HORIZONTAL * 0), 1.0, RGB_CHANNEL, POSITION_NOW_OFFSET, "X,Y,Z - PositionNow", -1.0, 1.0);
//the coord from default dataset
addHelperGeometry();
addComputationResultsRenderTree();
}
//taken from osgdistorsion example for getting it nice on screen with antialiasing
osg::Node* createPrerenderSubgraph(osg::Node* subgraph, const osg::Vec4& clearColour)
{
osg::Group* prerenderNode = new osg::Group;
unsigned int tex_width = PRERENDER_WIDTH;
unsigned int tex_height = PRERENDER_HEIGHT;
osg::Texture2D* texture = new osg::Texture2D;
texture->setTextureSize(tex_width, tex_height);
texture->setInternalFormat(GL_RGBA);
texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);
{
osg::Camera* prerenderCamera = new osg::Camera;
prerenderCamera->setClearColor(clearColour);
prerenderCamera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
prerenderCamera->setReferenceFrame(osg::Transform::RELATIVE_RF);
prerenderCamera->setProjectionMatrix(osg::Matrixd::identity());
prerenderCamera->setViewMatrix(osg::Matrixd::identity());
prerenderCamera->setViewport(0, 0, tex_width, tex_height);
prerenderCamera->setRenderOrder(osg::Camera::PRE_RENDER);
prerenderCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
prerenderCamera->attach(osg::Camera::COLOR_BUFFER0, texture, 0, 0, false, PRERENDER_ANTIALIASINGMULTISAMPLES, PRERENDER_ANTIALIASINGMULTISAMPLES);
prerenderCamera->addChild(subgraph);
prerenderNode->addChild(prerenderCamera);
}
{
osg::Geometry* polyGeom = new osg::Geometry();
polyGeom->setSupportsDisplayList(false);
osg::Vec3 origin(0.0f, 0.0f, 0.0f);
osg::Vec3 xAxis(1.0f, 0.0f, 0.0f);
osg::Vec3 yAxis(0.0f, 1.0f, 0.0f);
float height = 1024.0f;
float width = 1280.0f;
int noSteps = 3;
osg::Vec3Array* vertices = new osg::Vec3Array;
osg::Vec2Array* texcoords = new osg::Vec2Array;
osg::Vec4Array* colors = new osg::Vec4Array;
osg::Vec3 bottom = origin;
osg::Vec3 dx = xAxis*(width / ((float)(noSteps - 1)));
osg::Vec3 dy = yAxis*(height / ((float)(noSteps - 1)));
osg::Vec2 bottom_texcoord(0.0f, 0.0f);
osg::Vec2 dx_texcoord(1.0f / (float)(noSteps - 1), 0.0f);
osg::Vec2 dy_texcoord(0.0f, 1.0f / (float)(noSteps - 1));
int i, j;
for (i = 0; i < noSteps; ++i)
{
osg::Vec3 cursor = bottom + dy*(float)i;
osg::Vec2 texcoord = bottom_texcoord + dy_texcoord*(float)i;
for (j = 0; j < noSteps; ++j)
{
vertices->push_back(cursor);
texcoords->push_back(osg::Vec2((sin(texcoord.x()*osg::PI - osg::PI*0.5) + 1.0f)*0.5f, (sin(texcoord.y()*osg::PI - osg::PI*0.5) + 1.0f)*0.5f));
colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
cursor += dx;
texcoord += dx_texcoord;
}
}
polyGeom->setVertexArray(vertices);
polyGeom->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
polyGeom->setTexCoordArray(0, texcoords);
for (i = 0; i < noSteps - 1; ++i)
{
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(osg::PrimitiveSet::QUAD_STRIP);
for (j = 0; j < noSteps; ++j)
{
elements->push_back(j + (i + 1)*noSteps);
elements->push_back(j + (i)*noSteps);
}
polyGeom->addPrimitiveSet(elements);
}
osg::StateSet* stateset = polyGeom->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
osg::Geode* geode = new osg::Geode();
geode->addDrawable(polyGeom);
osg::Camera* nestedRenderCamera = new osg::Camera;
nestedRenderCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
nestedRenderCamera->setViewMatrix(osg::Matrix::identity());
nestedRenderCamera->setProjectionMatrixAsOrtho2D(0, 1280, 0, 1024);
nestedRenderCamera->setRenderOrder(osg::Camera::NESTED_RENDER);
nestedRenderCamera->addChild(geode);
prerenderNode->addChild(nestedRenderCamera);
}
return prerenderNode;
}
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer;
osg::ref_ptr<osg::Group> scene = new osg::Group;
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
viewer.addEventHandler(new osgViewer::ThreadingHandler);
viewer.getCamera()->setProjectionMatrixAsPerspective(60.0f, 1.33333, 0.01, 100.0);
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
viewer.setUpViewInWindow(11, 11, 800 + 11, 600 + 11);
//viewer.setUpViewOnSingleScreen(0); // !!
viewer.getCamera()->setClearColor(osg::Vec4(0.3, 0.3, 0.3, 1.0));
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);// we can play with threading models later
osg::ref_ptr<ComputeNode> computeNode = new ComputeNode();
computeNode->setPosition(osg::Vec3(0, 0, 0));
computeNode->setUpdateCallback(new ComputeNodeUpdateCallback(computeNode.get())); // on-the-fly reloading the shaders if shader source on disk is changed
computeNode->initComputingSetup();
scene->addChild(computeNode.get());
scene->addChild(computeNode->_computationResultsRenderGroup.get());
#ifdef PRERENDER_HIGH_QUALITY_ANTIALIASING
viewer.setSceneData(createPrerenderSubgraph(scene.get(), osg::Vec4(0.3, 0.4, 0.6, 1)));
#else
viewer.setSceneData(scene.get());
#endif
viewer.realize();
viewer.getCamera()->getGraphicsContext()->getState()->setUseModelViewAndProjectionUniforms(true);
viewer.run();
return 1;
}

View File

@@ -20,8 +20,6 @@
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers> #include <osgViewer/ViewerEventHandlers>
#include <osg/ContextData>
#include <osgDB/ReadFile> #include <osgDB/ReadFile>
#include <osgDB/WriteFile> #include <osgDB/WriteFile>
#include <osgDB/FileNameUtils> #include <osgDB/FileNameUtils>
@@ -58,7 +56,18 @@ public:
traverse(node); traverse(node);
} }
void apply(osg::Drawable& drawable) void apply(osg::Geode& node)
{
if (!_useStateSets && node.getStateSet()) node.setStateSet(0);
for(unsigned int i = 0; i<node.getNumDrawables(); ++i)
{
process(*node.getDrawable(i));
}
traverse(node);
}
void process(osg::Drawable& drawable)
{ {
if (!_useStateSets && drawable.getStateSet()) if (!_useStateSets && drawable.getStateSet())
{ {
@@ -104,9 +113,9 @@ public:
{ {
if (!stateset) return; if (!stateset) return;
for(unsigned int ti=0; ti<stateset->getNumTextureAttributeLists(); ++ti) for(unsigned int i=0; i<stateset->getNumTextureAttributeLists(); ++i)
{ {
osg::StateAttribute* sa = stateset->getTextureAttribute(ti, osg::StateAttribute::TEXTURE); osg::StateAttribute* sa = stateset->getTextureAttribute(i, osg::StateAttribute::TEXTURE);
osg::Texture* texture = dynamic_cast<osg::Texture*>(sa); osg::Texture* texture = dynamic_cast<osg::Texture*>(sa);
if (texture) if (texture)
{ {
@@ -256,7 +265,9 @@ public:
{ {
OSG_NOTICE<<"Reallocating Arrays"<<std::endl; OSG_NOTICE<<"Reallocating Arrays"<<std::endl;
typedef std::vector< osg::ref_ptr<osg::Array> > ArrayVector;
typedef std::vector< osg::ref_ptr<osg::Geometry> > GeometryVector; typedef std::vector< osg::ref_ptr<osg::Geometry> > GeometryVector;
ArrayVector newArrays;
GeometryVector newGeometries; GeometryVector newGeometries;
for(GeometryMap::iterator itr = _geometryMap.begin(); for(GeometryMap::iterator itr = _geometryMap.begin();
itr != _geometryMap.end(); itr != _geometryMap.end();
@@ -393,6 +404,8 @@ public:
while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; } while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; }
while (arguments.read("-s", simplificatioRatio)) {} while (arguments.read("-s", simplificatioRatio)) {}
while (arguments.read("--tristripper")) { useTriStripVisitor=true; }
while (arguments.read("--no-tristripper")) { useTriStripVisitor=false; }
while (arguments.read("--smoother")) { useSmoothingVisitor=true; } while (arguments.read("--smoother")) { useSmoothingVisitor=true; }
while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; } while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; }
@@ -424,6 +437,7 @@ public:
OSG_NOTICE<<"Running simplifier with simplification ratio="<<simplificatioRatio<<std::endl; OSG_NOTICE<<"Running simplifier with simplification ratio="<<simplificatioRatio<<std::endl;
float maxError = 4.0f; float maxError = 4.0f;
osgUtil::Simplifier simplifier(simplificatioRatio, maxError); osgUtil::Simplifier simplifier(simplificatioRatio, maxError);
simplifier.setDoTriStrip(useTriStripVisitor);
simplifier.setSmoothing(useSmoothingVisitor); simplifier.setSmoothing(useSmoothingVisitor);
node->accept(simplifier); node->accept(simplifier);
} }
@@ -501,7 +515,7 @@ protected:
optimizeVertexOrder = false; optimizeVertexOrder = false;
reallocateMemory = false; reallocateMemory = false;
modifyTextureSettings = false; modifyTextureSettings = false;
buildImageMipmaps = false; buildImageMipmaps = false;
compressImages = false; compressImages = false;
@@ -521,23 +535,22 @@ protected:
bool optimizeVertexOrder; bool optimizeVertexOrder;
bool reallocateMemory; bool reallocateMemory;
bool modifyTextureSettings; bool modifyTextureSettings;
bool buildImageMipmaps; bool buildImageMipmaps;
bool compressImages; bool compressImages;
bool disableMipmaps; bool disableMipmaps;
}; };
// //
class DatabasePagingOperation : public osg::Operation, public osgUtil::IncrementalCompileOperation::CompileCompletedCallback class DatabasePagingOperation : public osg::Operation, public osgUtil::IncrementalCompileOperation::CompileCompletedCallback
{ {
public: public:
DatabasePagingOperation(const std::string& filename, DatabasePagingOperation(const std::string& filename,
const std::string& outputFilename, const std::string& outputFilename,
SceneGraphProcessor* sceneGraphProcessor, SceneGraphProcessor* sceneGraphProcessor,
osgUtil::IncrementalCompileOperation* ico): osgUtil::IncrementalCompileOperation* ico):
osg::Referenced(true),
Operation("DatabasePaging Operation", false), Operation("DatabasePaging Operation", false),
_filename(filename), _filename(filename),
_outputFilename(outputFilename), _outputFilename(outputFilename),
@@ -547,12 +560,12 @@ public:
{ {
} }
virtual void operator () (osg::Object* /*object*/) virtual void operator () (osg::Object* object)
{ {
osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl; osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
_modelReadyToMerge = false; _modelReadyToMerge = false;
_loadedModel = osgDB::readRefNodeFile(_filename); _loadedModel = osgDB::readNodeFile(_filename);
if (_loadedModel.valid()) if (_loadedModel.valid())
{ {
@@ -567,7 +580,7 @@ public:
if (!_outputFilename.empty()) if (!_outputFilename.empty())
{ {
OSG_NOTICE<<"Writing out file "<<_outputFilename<<std::endl; OSG_NOTICE<<"Writing out file "<<_outputFilename<<std::endl;
osgDB::writeNodeFile(*_loadedModel, _outputFilename); osgDB::writeNodeFile(*_loadedModel, _outputFilename);
} }
@@ -591,7 +604,7 @@ public:
osg::notify(osg::NOTICE)<<"done LoadAndCompileOperation "<<_filename<<std::endl; osg::notify(osg::NOTICE)<<"done LoadAndCompileOperation "<<_filename<<std::endl;
} }
virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* /*compileSet*/) virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* compileSet)
{ {
OSG_NOTICE<<"compileCompleted"<<std::endl; OSG_NOTICE<<"compileCompleted"<<std::endl;
_modelReadyToMerge = true; _modelReadyToMerge = true;
@@ -609,13 +622,14 @@ public:
class TexturePoolHandler : public osgGA::GUIEventHandler class TexturePoolHandler : public osgGA::GUIEventHandler
{ {
public: public:
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/) virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{ {
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{ {
if (ea.getKey()=='r') if (ea.getKey()=='r')
{ {
osg::getOrCreateContextData(0)->reportStats(osg::notify(osg::NOTICE)); osg::Texture::getTextureObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
osg::GLBufferObjectManager::getGLBufferObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
} }
} }
return false; return false;
@@ -627,7 +641,8 @@ struct ReportStatsAnimationCompletedCallback : public osgGA::AnimationPathManipu
virtual void completed(const osgGA::AnimationPathManipulator*) virtual void completed(const osgGA::AnimationPathManipulator*)
{ {
OSG_NOTICE<<"Animation completed"<<std::endl; OSG_NOTICE<<"Animation completed"<<std::endl;
osg::getOrCreateContextData(0)->reportStats(osg::notify(osg::NOTICE)); osg::Texture::getTextureObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
osg::GLBufferObjectManager::getGLBufferObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
} }
}; };
@@ -659,7 +674,7 @@ int main(int argc, char** argv)
{ {
apm->setTimeScale(animationSpeed); apm->setTimeScale(animationSpeed);
apm->setAnimationCompletedCallback(new ReportStatsAnimationCompletedCallback()); apm->setAnimationCompletedCallback(new ReportStatsAnimationCompletedCallback());
unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
keyswitchManipulator->selectMatrixManipulator(num); keyswitchManipulator->selectMatrixManipulator(num);
@@ -670,7 +685,7 @@ int main(int argc, char** argv)
viewer.setCameraManipulator( keyswitchManipulator.get() ); viewer.setCameraManipulator( keyswitchManipulator.get() );
} }
// set up event handlers // set up event handlers
{ {
viewer.addEventHandler( new osgViewer::StatsHandler()); viewer.addEventHandler( new osgViewer::StatsHandler());
viewer.addEventHandler( new osgViewer::WindowSizeHandler() ); viewer.addEventHandler( new osgViewer::WindowSizeHandler() );
@@ -777,8 +792,8 @@ int main(int argc, char** argv)
modelIndex<fileNames.size() && modelIndex<fileNames.size() &&
(currentTime-timeOfLastMerge)>timeBetweenMerges) (currentTime-timeOfLastMerge)>timeBetweenMerges)
{ {
filename = fileNames[modelIndex++]; std::string filename = fileNames[modelIndex++];
outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix; std::string outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix;
databasePagingOperation = new DatabasePagingOperation( databasePagingOperation = new DatabasePagingOperation(
filename, filename,
@@ -792,7 +807,7 @@ int main(int argc, char** argv)
if (databasePagingOperation.get() && databasePagingOperation->_modelReadyToMerge) if (databasePagingOperation.get() && databasePagingOperation->_modelReadyToMerge)
{ {
OSG_NOTICE<<"Merging subgraph"<<std::endl; OSG_NOTICE<<"Merging subgraph"<<std::endl;
timeOfLastMerge = currentTime; timeOfLastMerge = currentTime;
group->removeChildren(0,group->getNumChildren()); group->removeChildren(0,group->getNumChildren());

View File

@@ -26,7 +26,6 @@
#include <osgDB/Registry> #include <osgDB/Registry>
#include <osgDB/ReadFile> #include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgGA/TrackballManipulator> #include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator> #include <osgGA/FlightManipulator>
@@ -137,9 +136,9 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength); osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength);
osg::ref_ptr<osg::Group> model = new osg::Group; osg::Group* model = new osg::Group;
osg::ref_ptr<osg::Node> glider = osgDB::readRefNodeFile("glider.osgt"); osg::Node* glider = osgDB::readNodeFile("glider.osgt");
if (glider) if (glider)
{ {
const osg::BoundingSphere& bs = glider->getBound(); const osg::BoundingSphere& bs = glider->getBound();
@@ -147,7 +146,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
float size = radius/bs.radius()*0.3f; float size = radius/bs.radius()*0.3f;
osg::MatrixTransform* positioned = new osg::MatrixTransform; osg::MatrixTransform* positioned = new osg::MatrixTransform;
positioned->setDataVariance(osg::Object::STATIC); positioned->setDataVariance(osg::Object::STATIC);
positioned ->setMatrix(osg::Matrix::translate(-bs.center())* positioned->setMatrix(osg::Matrix::translate(-bs.center())*
osg::Matrix::scale(size,size,size)* osg::Matrix::scale(size,size,size)*
osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f)); osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f));
@@ -160,7 +159,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
model->addChild(xform); model->addChild(xform);
} }
osg::ref_ptr<osg::Node> cessna = osgDB::readRefNodeFile("cessna.osgt"); osg::Node* cessna = osgDB::readNodeFile("cessna.osgt");
if (cessna) if (cessna)
{ {
const osg::BoundingSphere& bs = cessna->getBound(); const osg::BoundingSphere& bs = cessna->getBound();
@@ -174,30 +173,26 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
positioned->addChild(cessna); positioned->addChild(cessna);
osg::ref_ptr<osg::MatrixTransform> xform = new osg::MatrixTransform; osg::MatrixTransform* xform = new osg::MatrixTransform;
xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0f,2.0)); xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0f,2.0));
xform->addChild(positioned); xform->addChild(positioned);
model->addChild(xform); model->addChild(xform);
} }
#ifndef OSG_GLES2_AVAILABLE return model;
model->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
#endif
return model.release();
} }
osg::ref_ptr<osg::Group> createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique) osg::Node* createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique)
{ {
osg::Vec3 center(0.0f,0.0f,0.0f); osg::Vec3 center(0.0f,0.0f,0.0f);
float radius = 100.0f; float radius = 100.0f;
osg::ref_ptr<osg::Group> root = new osg::Group; osg::Group* root = new osg::Group;
float baseHeight = center.z()-radius*0.5; float baseHeight = center.z()-radius*0.5;
osg::ref_ptr<osg::Node> baseModel = createBase(osg::Vec3(center.x(), center.y(), baseHeight),radius); osg::Node* baseModel = createBase(osg::Vec3(center.x(), center.y(), baseHeight),radius);
osg::ref_ptr<osg::Node> movingModel = createMovingModel(center,radius*0.8f); osg::Node* movingModel = createMovingModel(center,radius*0.8f);
if (overlay) if (overlay)
{ {
@@ -237,14 +232,14 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::ref_ptr<osg::Group> model = createModel(overlay, technique); osg::Node* model = createModel(overlay, technique);
if (!model) if (!model)
{ {
return 1; return 1;
} }
// tilt the scene so the default eye position is looking down on the model. // tilt the scene so the default eye position is looking down on the model.
osg::ref_ptr<osg::MatrixTransform> rootnode = new osg::MatrixTransform; osg::MatrixTransform* rootnode = new osg::MatrixTransform;
rootnode->setMatrix(osg::Matrix::rotate(osg::inDegrees(30.0f),1.0f,0.0f,0.0f)); rootnode->setMatrix(osg::Matrix::rotate(osg::inDegrees(30.0f),1.0f,0.0f,0.0f));
rootnode->addChild(model); rootnode->addChild(model);
@@ -252,13 +247,6 @@ int main( int argc, char **argv )
osgUtil::Optimizer optimzer; osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode); optimzer.optimize(rootnode);
std::string filename;
if (arguments.read("-o",filename))
{
osgDB::writeNodeFile(*rootnode, filename);
return 1;
}
// set the scene to render // set the scene to render
viewer.setSceneData(rootnode); viewer.setSceneData(rootnode);

View File

@@ -317,8 +317,7 @@ public:
} }
}; };
int main(int, char**) int main(int argc, char** argv) {
{
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager( osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- /* -*-c++-*-
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net> * Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
* *
* This library is open source and may be redistributed and/or modified under * This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file * (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website. * included with this distribution, and on the openscenegraph.org website.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * OpenSceneGraph Public License for more details.
*/ */
@@ -28,8 +28,6 @@
#include <osgAnimation/BasicAnimationManager> #include <osgAnimation/BasicAnimationManager>
#include <osgAnimation/RigGeometry> #include <osgAnimation/RigGeometry>
#include <osgAnimation/RigTransformHardware> #include <osgAnimation/RigTransformHardware>
#include <osgAnimation/MorphGeometry>
#include <osgAnimation/MorphTransformHardware>
#include <osgAnimation/AnimationManagerBase> #include <osgAnimation/AnimationManagerBase>
#include <osgAnimation/BoneMapVisitor> #include <osgAnimation/BoneMapVisitor>
@@ -42,100 +40,89 @@ static unsigned int getRandomValueinRange(unsigned int v)
} }
osg::ref_ptr<osg::Program> CommonProgram; osg::ref_ptr<osg::Program> program;
// show how to override the default RigTransformHardware for customized usage // show how to override the default RigTransformHardware for customized usage
struct MyRigTransformHardware : public osgAnimation::RigTransformHardware struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
{ {
int _maxmatrix;
MyRigTransformHardware() : _maxmatrix(99){} void operator()(osgAnimation::RigGeometry& geom)
virtual bool init(osgAnimation::RigGeometry& rig)
{ {
if(_perVertexInfluences.empty()) if (_needInit)
{ if (!init(geom))
prepareData(rig); return;
computeMatrixPaletteUniform(geom.getMatrixFromSkeletonToGeometry(), geom.getInvMatrixFromSkeletonToGeometry());
}
bool init(osgAnimation::RigGeometry& geom)
{
osg::Vec3Array* pos = dynamic_cast<osg::Vec3Array*>(geom.getVertexArray());
if (!pos) {
osg::notify(osg::WARN) << "RigTransformHardware no vertex array in the geometry " << geom.getName() << std::endl;
return false; return false;
} }
if(!rig.getSkeleton())
if (!geom.getSkeleton()) {
osg::notify(osg::WARN) << "RigTransformHardware no skeleting set in geometry " << geom.getName() << std::endl;
return false; return false;
}
osgAnimation::BoneMapVisitor mapVisitor; osgAnimation::BoneMapVisitor mapVisitor;
rig.getSkeleton()->accept(mapVisitor); geom.getSkeleton()->accept(mapVisitor);
osgAnimation::BoneMap boneMap = mapVisitor.getBoneMap(); osgAnimation::BoneMap bm = mapVisitor.getBoneMap();
if (!buildPalette(boneMap,rig) ) if (!createPalette(pos->size(),bm, geom.getVertexInfluenceSet().getVertexToBoneList()))
return false; return false;
osg::Geometry& source = *rig.getSourceGeometry(); int attribIndex = 11;
osg::Vec3Array* positionSrc = dynamic_cast<osg::Vec3Array*>(source.getVertexArray()); int nbAttribs = getNumVertexAttrib();
if (!positionSrc) // use a global program for all avatar
{ if (!program.valid()) {
OSG_WARN << "RigTransformHardware no vertex array in the geometry " << rig.getName() << std::endl; program = new osg::Program;
return false; program->setName("HardwareSkinning");
} if (!_shader.valid())
_shader = osg::Shader::readShaderFile(osg::Shader::VERTEX,"shaders/skinning.vert");
// copy shallow from source geometry to rig if (!_shader.valid()) {
rig.copyFrom(source); osg::notify(osg::WARN) << "RigTransformHardware can't load VertexShader" << std::endl;
osg::ref_ptr<osg::Shader> vertexshader;
osg::ref_ptr<osg::StateSet> stateset = rig.getOrCreateStateSet();
if(!CommonProgram.valid())
{
CommonProgram = new osg::Program;
CommonProgram->setName("HardwareSkinning");
//set default source if _shader is not user set
if (!vertexshader.valid())
{
vertexshader = osgDB::readRefShaderFile(osg::Shader::VERTEX,"skinning.vert");
}
if (!vertexshader.valid())
{
OSG_WARN << "RigTransformHardware can't load VertexShader" << std::endl;
return false; return false;
} }
// replace max matrix by the value from uniform // replace max matrix by the value from uniform
{ {
std::string str = vertexshader->getShaderSource(); std::string str = _shader->getShaderSource();
std::string toreplace = std::string("MAX_MATRIX"); std::string toreplace = std::string("MAX_MATRIX");
std::size_t start = str.find(toreplace); std::size_t start = str.find(toreplace);
if (std::string::npos != start) std::stringstream ss;
{ ss << getMatrixPaletteUniform()->getNumElements();
std::stringstream ss; str.replace(start, toreplace.size(), ss.str());
ss << _maxmatrix;//getMatrixPaletteUniform()->getNumElements(); _shader->setShaderSource(str);
str.replace(start, toreplace.size(), ss.str()); osg::notify(osg::INFO) << "Shader " << str << std::endl;
vertexshader->setShaderSource(str);
}
else
{
OSG_WARN<< "MAX_MATRIX not found in Shader! " << str << std::endl;
}
OSG_INFO << "Shader " << str << std::endl;
} }
CommonProgram->addShader(vertexshader.get());
} program->addShader(_shader.get());
unsigned int nbAttribs = getNumVertexAttrib(); for (int i = 0; i < nbAttribs; i++)
for (unsigned int i = 0; i < nbAttribs; i++) {
std::stringstream ss;
ss << "boneWeight" << i;
program->addBindAttribLocation(ss.str(), attribIndex + i);
osg::notify(osg::INFO) << "set vertex attrib " << ss.str() << std::endl;
}
}
for (int i = 0; i < nbAttribs; i++)
{ {
std::stringstream ss; std::stringstream ss;
ss << "boneWeight" << i; ss << "boneWeight" << i;
CommonProgram->addBindAttribLocation(ss.str(), _minAttribIndex + i); geom.setVertexAttribArray(attribIndex + i, getVertexAttrib(i));
rig.setVertexAttribArray(_minAttribIndex + i, getVertexAttrib(i));
OSG_INFO << "set vertex attrib " << ss.str() << std::endl;
} }
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
stateset->removeUniform("nbBonesPerVertex"); ss->addUniform(getMatrixPaletteUniform());
stateset->addUniform(new osg::Uniform("nbBonesPerVertex",_bonesPerVertex)); ss->addUniform(new osg::Uniform("nbBonesPerVertex", getNumBonesPerVertex()));
ss->setAttributeAndModes(program.get());
stateset->removeUniform("matrixPalette"); geom.setStateSet(ss.get());
stateset->addUniform(_uniformMatrixPalette);
stateset->setAttribute(CommonProgram.get());
_needInit = false; _needInit = false;
return true; return true;
} }
@@ -146,9 +133,8 @@ struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
struct SetupRigGeometry : public osg::NodeVisitor struct SetupRigGeometry : public osg::NodeVisitor
{ {
bool _hardware; bool _hardware;
SetupRigGeometry( bool hardware = true) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _hardware(hardware) {} SetupRigGeometry( bool hardware = true) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _hardware(hardware) {}
void apply(osg::Geode& geode) void apply(osg::Geode& geode)
{ {
for (unsigned int i = 0; i < geode.getNumDrawables(); i++) for (unsigned int i = 0; i < geode.getNumDrawables(); i++)
@@ -156,15 +142,10 @@ struct SetupRigGeometry : public osg::NodeVisitor
} }
void apply(osg::Drawable& geom) void apply(osg::Drawable& geom)
{ {
if (_hardware) if (_hardware) {
{
osgAnimation::RigGeometry* rig = dynamic_cast<osgAnimation::RigGeometry*>(&geom); osgAnimation::RigGeometry* rig = dynamic_cast<osgAnimation::RigGeometry*>(&geom);
if (rig) if (rig)
{
rig->setRigTransformImplementation(new MyRigTransformHardware); rig->setRigTransformImplementation(new MyRigTransformHardware);
osgAnimation::MorphGeometry *morph=dynamic_cast<osgAnimation::MorphGeometry*>(rig->getSourceGeometry());
if(morph)morph->setMorphTransformImplementation(new osgAnimation::MorphTransformHardware);
}
} }
#if 0 #if 0
@@ -188,12 +169,11 @@ osg::Group* createCharacterInstance(osg::Group* character, bool hardware)
osgAnimation::BasicAnimationManager* anim = dynamic_cast<osgAnimation::BasicAnimationManager*>(animationManager); osgAnimation::BasicAnimationManager* anim = dynamic_cast<osgAnimation::BasicAnimationManager*>(animationManager);
const osgAnimation::AnimationList& list = animationManager->getAnimationList(); const osgAnimation::AnimationList& list = animationManager->getAnimationList();
int v = getRandomValueinRange(list.size()); int v = getRandomValueinRange(list.size());
if (list[v]->getName() == std::string("MatIpo_ipo")) if (list[v]->getName() == std::string("MatIpo_ipo")) {
{
anim->playAnimation(list[v].get()); anim->playAnimation(list[v].get());
v = (v + 1)%list.size(); v = (v + 1)%list.size();
} }
anim->playAnimation(list[v].get()); anim->playAnimation(list[v].get());
SetupRigGeometry switcher(hardware); SetupRigGeometry switcher(hardware);
@@ -213,15 +193,12 @@ int main (int argc, char* argv[])
bool hardware = true; bool hardware = true;
int maxChar = 10; int maxChar = 10;
while (psr.read("--software")) while (psr.read("--software")) { hardware = false; }
{
hardware = false;
}
while (psr.read("--number", maxChar)) {} while (psr.read("--number", maxChar)) {}
osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFiles(psr);
osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(node.get()); osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(psr));
if (!root) if (!root)
{ {
std::cout << psr.getApplicationName() <<": No data loaded" << std::endl; std::cout << psr.getApplicationName() <<": No data loaded" << std::endl;
return 1; return 1;
@@ -229,7 +206,7 @@ int main (int argc, char* argv[])
{ {
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback()); osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
if(!animationManager) if(!animationManager)
{ {
osg::notify(osg::FATAL) << "no AnimationManagerBase found, updateCallback need to animate elements" << std::endl; osg::notify(osg::FATAL) << "no AnimationManagerBase found, updateCallback need to animate elements" << std::endl;
return 1; return 1;
@@ -241,13 +218,13 @@ int main (int argc, char* argv[])
// add the state manipulator // add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// add the thread model handler // add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler); viewer.addEventHandler(new osgViewer::ThreadingHandler);
// add the window size toggle handler // add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler);
// add the stats handler // add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::StatsHandler);
@@ -266,10 +243,9 @@ int main (int argc, char* argv[])
double xChar = maxChar; double xChar = maxChar;
double yChar = xChar * 9.0/16; double yChar = xChar * 9.0/16;
for (double i = 0.0; i < xChar; i++) for (double i = 0.0; i < xChar; i++) {
{ for (double j = 0.0; j < yChar; j++) {
for (double j = 0.0; j < yChar; j++)
{
osg::ref_ptr<osg::Group> c = createCharacterInstance(root.get(), hardware); osg::ref_ptr<osg::Group> c = createCharacterInstance(root.get(), hardware);
osg::MatrixTransform* tr = new osg::MatrixTransform; osg::MatrixTransform* tr = new osg::MatrixTransform;
tr->setMatrix(osg::Matrix::translate( 2.0 * (i - xChar * .5), tr->setMatrix(osg::Matrix::translate( 2.0 * (i - xChar * .5),
@@ -281,6 +257,7 @@ int main (int argc, char* argv[])
} }
std::cout << "created " << xChar * yChar << " instance" << std::endl; std::cout << "created " << xChar * yChar << " instance" << std::endl;
return viewer.run(); return viewer.run();
} }

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- /* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net> * Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
* *
* This library is open source and may be redistributed and/or modified under * This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file * (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website. * included with this distribution, and on the openscenegraph.org website.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * OpenSceneGraph Public License for more details.
* *
* Authors: * Authors:
@@ -33,7 +33,7 @@
public: public:
META_Object(osgAnimation, AnimtkUpdateCallback); META_Object(osgAnimation, AnimtkUpdateCallback);
AnimtkUpdateCallback() AnimtkUpdateCallback()
{ {
_sampler = new osgAnimation::Vec3CubicBezierSampler; _sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false; _playing = false;
@@ -41,7 +41,6 @@
} }
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop), osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::NodeCallback(val, copyop), osg::NodeCallback(val, copyop),
_sampler(val._sampler), _sampler(val._sampler),
_startTime(val._startTime), _startTime(val._startTime),
@@ -53,16 +52,16 @@
/** Callback method called by the NodeVisitor when visiting a node.*/ /** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{ {
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() && nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{ {
_lastUpdate = nv->getFrameStamp()->getFrameNumber(); _lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick(); _currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{ {
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node); osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
if (transform) { if (transform) {
@@ -98,7 +97,7 @@ class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
public: public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback); META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
AnimtkStateSetUpdateCallback() AnimtkStateSetUpdateCallback()
{ {
_sampler = new osgAnimation::Vec4LinearSampler; _sampler = new osgAnimation::Vec4LinearSampler;
_playing = false; _playing = false;
@@ -107,7 +106,6 @@ public:
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop), osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::StateSet::Callback(val, copyop), osg::StateSet::Callback(val, copyop),
_sampler(val._sampler), _sampler(val._sampler),
_startTime(val._startTime), _startTime(val._startTime),
@@ -119,19 +117,19 @@ public:
/** Callback method called by the NodeVisitor when visiting a node.*/ /** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv) virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{ {
if (state && if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() && nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) { nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
_lastUpdate = nv->getFrameStamp()->getFrameNumber(); _lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick(); _currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{ {
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL)); osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
if (material) if (material)
{ {
osg::Vec4 result; osg::Vec4 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime); float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
@@ -157,7 +155,7 @@ public:
// This won't really give good results in any situation, but it does demonstrate // This won't really give good results in any situation, but it does demonstrate
// on possible "fast" usage... // on possible "fast" usage...
class MakePathTimeCallback: public AnimtkUpdateCallback class MakePathTimeCallback: public AnimtkUpdateCallback
{ {
osg::ref_ptr<osg::Geode> _geode; osg::ref_ptr<osg::Geode> _geode;
float _lastAdd; float _lastAdd;
@@ -170,11 +168,11 @@ public:
_addSeconds(0.08f) { _addSeconds(0.08f) {
} }
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{ {
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime); float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
if(_lastAdd + _addSeconds <= t && t <= 8.0f) if(_lastAdd + _addSeconds <= t && t <= 8.0f)
{ {
osg::Vec3 pos; osg::Vec3 pos;
@@ -192,7 +190,7 @@ public:
// This will give great results if you DO NOT have VSYNC enabled and can generate // This will give great results if you DO NOT have VSYNC enabled and can generate
// decent FPS. // decent FPS.
class MakePathDistanceCallback: public AnimtkUpdateCallback class MakePathDistanceCallback: public AnimtkUpdateCallback
{ {
osg::ref_ptr<osg::Geode> _geode; osg::ref_ptr<osg::Geode> _geode;
osg::Vec3 _lastAdd; osg::Vec3 _lastAdd;
@@ -205,7 +203,7 @@ public:
_threshold(0.5f), _threshold(0.5f),
_count(0) {} _count(0) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{ {
static bool countReported = false; static bool countReported = false;
@@ -217,13 +215,13 @@ public:
osg::Vec3 distance = _lastAdd - pos; osg::Vec3 distance = _lastAdd - pos;
if(t <= 8.0f && distance.length() >= _threshold) if(t <= 8.0f && distance.length() >= _threshold)
{ {
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f))); _geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
_lastAdd = pos; _lastAdd = pos;
_count++; _count++;
} }
else if(t > 8.0f) else if(t > 8.0f)
{ {
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl; if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
countReported = true; countReported = true;
@@ -233,13 +231,13 @@ public:
} }
}; };
osg::StateSet* setupStateSet() osg::StateSet* setupStateSet()
{ {
osg::StateSet* st = new osg::StateSet(); osg::StateSet* st = new osg::StateSet();
st->setAttributeAndModes(new osg::Material(), true); st->setAttributeAndModes(new osg::Material(), true);
st->setMode(GL_BLEND, true); st->setMode(GL_BLEND, true);
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback(); AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer(); osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1))); keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
@@ -250,11 +248,11 @@ osg::StateSet* setupStateSet()
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1))); keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
callback->start(); callback->start();
st->setUpdateCallback(callback); st->setUpdateCallback(callback);
return st; return st;
} }
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode) osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
{ {
osg::Vec3 v[5]; osg::Vec3 v[5];
@@ -302,20 +300,20 @@ osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
node->setUpdateCallback(callback); node->setUpdateCallback(callback);
osg::Geode* geode = new osg::Geode(); osg::Geode* geode = new osg::Geode();
geode->setStateSet(setupStateSet()); geode->setStateSet(setupStateSet());
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2))); geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
node->addChild(geode); node->addChild(geode);
return node; return node;
} }
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
osg::ArgumentParser arguments(&argc, argv); osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments); osgViewer::Viewer viewer(arguments);
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator(); osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
viewer.setCameraManipulator(tbm); viewer.setCameraManipulator(tbm);

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- /* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net> * Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
* *
* This library is open source and may be redistributed and/or modified under * This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file * (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website. * included with this distribution, and on the openscenegraph.org website.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details. * OpenSceneGraph Public License for more details.
*/ */
@@ -33,11 +33,11 @@ struct GeometryFinder : public osg::NodeVisitor
{ {
osg::ref_ptr<osg::Geometry> _geom; osg::ref_ptr<osg::Geometry> _geom;
GeometryFinder() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} GeometryFinder() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
void apply(osg::Geode& geode) void apply(osg::Geode& geode)
{ {
if (_geom.valid()) if (_geom.valid())
return; return;
for (unsigned int i = 0; i < geode.getNumDrawables(); i++) for (unsigned int i = 0; i < geode.getNumDrawables(); i++)
{ {
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode.getDrawable(i)); osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
if (geom) { if (geom) {
@@ -50,7 +50,7 @@ struct GeometryFinder : public osg::NodeVisitor
osg::ref_ptr<osg::Geometry> getShape(const std::string& name) osg::ref_ptr<osg::Geometry> getShape(const std::string& name)
{ {
osg::ref_ptr<osg::Node> shape0 = osgDB::readRefNodeFile(name); osg::ref_ptr<osg::Node> shape0 = osgDB::readNodeFile(name);
if (shape0) if (shape0)
{ {
GeometryFinder finder; GeometryFinder finder;
@@ -104,12 +104,10 @@ int main (int argc, char* argv[])
osg::Group* scene = new osg::Group; osg::Group* scene = new osg::Group;
scene->addUpdateCallback(bam); scene->addUpdateCallback(bam);
osg::Geode* geode = new osg::Geode; osg::Geode* geode = new osg::Geode;
geode->addDrawable(morph); geode->addDrawable(morph);
osgAnimation::UpdateMorph* morphupdate=new osgAnimation::UpdateMorph("MorphNodeCallback"); geode->addUpdateCallback(new osgAnimation::UpdateMorph("MorphNodeCallback"));
morphupdate->addTarget("MorphNodeCallback");
geode->addUpdateCallback(morphupdate);
scene->addChild(geode); scene->addChild(geode);
viewer.addEventHandler(new osgViewer::StatsHandler()); viewer.addEventHandler(new osgViewer::StatsHandler());

Some files were not shown because too many files have changed in this diff Show More