Compare commits
30 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5fe55956e | ||
|
|
98ce387440 | ||
|
|
744c1cc464 | ||
|
|
2be018230d | ||
|
|
e84e2b0025 | ||
|
|
46afd39b51 | ||
|
|
822fec0302 | ||
|
|
3ae660c8eb | ||
|
|
0a82439a9c | ||
|
|
b2db19e976 | ||
|
|
5d8ec3027e | ||
|
|
24b608cacb | ||
|
|
af9ccc5596 | ||
|
|
cc3d0903db | ||
|
|
faef4cea61 | ||
|
|
c3e42eda62 | ||
|
|
62ed1a838b | ||
|
|
a0e4779d76 | ||
|
|
c3e394ba3e | ||
|
|
5c312685cd | ||
|
|
d801620b6c | ||
|
|
22246158a5 | ||
|
|
bbd40ca107 | ||
|
|
2e11d93587 | ||
|
|
48e70c0948 | ||
|
|
38c14644d2 | ||
|
|
1f7febfa92 | ||
|
|
ed722b5fc7 | ||
|
|
f9fda5d081 | ||
|
|
97cb28ea8e |
189
AUTHORS.txt
189
AUTHORS.txt
@@ -1,6 +1,6 @@
|
||||
OpenSceneGraph Library 2.8.2
|
||||
OpenSceneGraph Library 2.6.0
|
||||
|
||||
373 Contributors:
|
||||
324 Contributors:
|
||||
|
||||
Firstname Surname
|
||||
-----------------
|
||||
@@ -9,99 +9,89 @@ Don Burns
|
||||
Marco Jez
|
||||
Paul Martz
|
||||
Mike Weiblen
|
||||
Mathias Fr<46>hlich
|
||||
Eric Wing
|
||||
Stephan Huber
|
||||
Brede Johansen
|
||||
Stephan Huber
|
||||
Geoff Michel
|
||||
Farshid Lashkari
|
||||
Bob Kuehne
|
||||
Ulrich Hertlein
|
||||
Mathias Fr<46>hlich
|
||||
Eric Sokolowsky
|
||||
Jean-Sebastien Guay
|
||||
Ulrich Hertlein
|
||||
Martin Lavery
|
||||
David Callu
|
||||
Tree
|
||||
Jean-Sebastien Guay
|
||||
Luigi Calori
|
||||
Trajce Nikolov
|
||||
Mike Wittman
|
||||
Wojciech Lewandowski
|
||||
Paul Melis
|
||||
Pavel Moloshtan
|
||||
Colin McDonald
|
||||
Tom Jolley
|
||||
Andy Skinner
|
||||
Roger James
|
||||
Pavel Moloshtan
|
||||
Mattias Helsing
|
||||
Tom Jolley
|
||||
Jeremy Moles
|
||||
Jason Beverage
|
||||
Norman Vine
|
||||
Cedric Pinson
|
||||
Art Tevs
|
||||
Jeremy Moles
|
||||
Alberto Farre
|
||||
Roland Smeenk
|
||||
Michael Platings
|
||||
Andr<EFBFBD> Garneau
|
||||
Wojciech Lewandowski
|
||||
Ruben Lopez
|
||||
Randall Hopper
|
||||
Jason Daly
|
||||
J.P. Delport
|
||||
Adrian Egli
|
||||
Art Tevs
|
||||
Olaf Flebbe
|
||||
Mathieu Marache
|
||||
Gideon May
|
||||
Don Tidrow
|
||||
Sherman Wilcox
|
||||
Romano Jos<6F> Magacho da Silva
|
||||
Per Fahlberg
|
||||
Philip Lowman
|
||||
Paul Melis
|
||||
Michael Platings
|
||||
Michael Gronager
|
||||
Joakim Simonsson
|
||||
David Spilling
|
||||
Daniel Sj<53>lie
|
||||
Chris Hanson
|
||||
Alberto Luaces
|
||||
Philip Lowman
|
||||
Chris Denham
|
||||
Adrian Egli
|
||||
Sherman Wilcox
|
||||
Per Fahlberg
|
||||
J.P. Delport
|
||||
David Spilling
|
||||
Melchior Franz
|
||||
Lionel Lagarde
|
||||
David Fries
|
||||
Bryan Thrall
|
||||
Terry Welsh
|
||||
Serge Lages
|
||||
Joran Jessurun
|
||||
Joakim Simonsson
|
||||
Jason Beverage
|
||||
Jason Daly
|
||||
Frederic Marmond
|
||||
David Fries
|
||||
Boris Bralo
|
||||
Yefei He
|
||||
Tim Moore
|
||||
Stephane Lamoliatte
|
||||
Terry Welsh
|
||||
Sondra Iverson
|
||||
Serge Lages
|
||||
Rune Schmidt Jensen
|
||||
Rainer Oder
|
||||
Neil Groves
|
||||
Mike Connell
|
||||
Martin Aumueller
|
||||
Mario Valle
|
||||
Gordon Tomlinson
|
||||
Gino van den Bergen
|
||||
Mathieu Marache
|
||||
Glenn Waldron
|
||||
Carlo Camporesi
|
||||
Ben Discoe
|
||||
Andreas Ekstrand
|
||||
Thibault Genessay
|
||||
Sukender
|
||||
Stephane Lamoliatte
|
||||
Sasa Bistrovic
|
||||
Martin Naylor
|
||||
Martin Aumueller
|
||||
Markus Trenkwalder
|
||||
Mario Valle
|
||||
Loic Dachary
|
||||
Joseph Steel
|
||||
John Shue
|
||||
Jan Peciva
|
||||
Jan Ciger
|
||||
Glenn Waldron
|
||||
Gordon Tomlinson
|
||||
Gino van den Bergen
|
||||
Bryan Thrall
|
||||
Brad Colbert
|
||||
Vivek Rajan
|
||||
Thibault Genessay
|
||||
Sean Spicer
|
||||
Ravi Mathur
|
||||
Peter Hrenka
|
||||
Nikolaus Hanekamp
|
||||
Neil Salter
|
||||
Mihai Radu
|
||||
@@ -110,48 +100,41 @@ Luc Frauciel
|
||||
Laurens Voerman
|
||||
David Guthrie
|
||||
Corbin Holtz
|
||||
Cedric Pinson
|
||||
Brad Christiansen
|
||||
Blasius Czink
|
||||
Toshiyuki Takahei
|
||||
Thom DeCarlo
|
||||
Tatsuhiro Nishioka
|
||||
Simon Julier
|
||||
Sebastien Grignard
|
||||
Romano Magacho
|
||||
Richard Schmidt
|
||||
Riccardo Corsi
|
||||
Ralf Habacker
|
||||
Roland Smeenk
|
||||
Paul de Repentigny
|
||||
Liang Aibin
|
||||
Leandro Motta Barros
|
||||
John Vidar Larring
|
||||
John Kelso
|
||||
Daniel Larimer
|
||||
Csaba Halasz
|
||||
Colin Dunlop
|
||||
Bruce Clay
|
||||
Alberto Luaces
|
||||
Alberto Barbati
|
||||
Vladimir Shabanov
|
||||
Uwe Woessner
|
||||
Tony Horrobin
|
||||
Tim Moore
|
||||
Sohey Yamamoto
|
||||
Rudolf Wiedemann
|
||||
Richard Schmidt
|
||||
Rafa Gaitan
|
||||
Phil Atkin
|
||||
Miguel Escriva
|
||||
Peter Hrenka
|
||||
Neil Groves
|
||||
Mattias Linde
|
||||
Mattias Helsing
|
||||
Maria Ten
|
||||
Ken Sewell
|
||||
Julian Ortiz
|
||||
Jeremy Bell
|
||||
Jaromir Vitek
|
||||
James French
|
||||
Gary Quinn
|
||||
Garrett Potts
|
||||
Gabor Dorka
|
||||
Fabio Mierlo
|
||||
Fabien Lavignotte
|
||||
Doug McCorkle
|
||||
Donn Mielcarek
|
||||
Donald Cipperly
|
||||
Domenico Mangieri
|
||||
@@ -159,69 +142,54 @@ Charles Cole
|
||||
Blake Williams
|
||||
Antoine Hue
|
||||
Andrew Bettison
|
||||
Andreas Goebel
|
||||
Anders Backman
|
||||
Ali Botorabi
|
||||
Zach Deedler
|
||||
Yuzhong Shen
|
||||
Wang Rui
|
||||
Tugkan Calapoglu
|
||||
Tim Daoust
|
||||
Terrex
|
||||
Tanguy Fautr<74>
|
||||
Sylvain Marie
|
||||
Steve Lunsford
|
||||
Stephane Simon
|
||||
Stephan Eilemann
|
||||
Stanislav Blinov
|
||||
Sergey Leontyev
|
||||
Sebastian Messerschmidt
|
||||
Rene Molenaar
|
||||
Rudolf Wiedemann
|
||||
Riccardo Corsi
|
||||
Ralf Kern
|
||||
Pierre Haritchabalet
|
||||
Perry Miller
|
||||
Paul Obermeier
|
||||
Neil Hughes
|
||||
Nathan Monteleone
|
||||
Morn<EFBFBD> Pistorius
|
||||
Miguel Escriva
|
||||
Michael Henheffer
|
||||
Michael Guerrero
|
||||
Maya Leonard
|
||||
Max Bandazian
|
||||
Max Behensky
|
||||
Mathew May
|
||||
Martin Spott
|
||||
Martijn Kragtwijk
|
||||
Konstantin Sinitsyn
|
||||
Liang Aibin
|
||||
Kevin Moiule
|
||||
Keith Steffen
|
||||
Katharina Plugge
|
||||
Joseph Winston
|
||||
John Aughey
|
||||
Johan Nouvel
|
||||
Jim Vaughan
|
||||
James Moliere
|
||||
Igor Kravtchenko
|
||||
He Sicong
|
||||
Gustavo Wagner
|
||||
Guillaume Chouvenc
|
||||
Gerrick Bivins
|
||||
George Tarantilis
|
||||
Frederic Bouvier
|
||||
Ferdi Smit
|
||||
Ewe Woessner
|
||||
Erik den Dekker
|
||||
Emmanuel Roche
|
||||
Fabio Mierlo
|
||||
Edgar Ellis
|
||||
Don Leich
|
||||
Doug McCorkle
|
||||
David Ergo
|
||||
Daniel Trstenjak
|
||||
Christophe Loustaunau
|
||||
Csaba Halasz
|
||||
Brad Anderegg
|
||||
Andrew Sampson
|
||||
Andrew Lorino
|
||||
Andreas Goebel
|
||||
Zbigniew Sroczynski
|
||||
Yuri Vilmanis
|
||||
Warren Macchi
|
||||
Wang Rui
|
||||
Wang Lam
|
||||
Walter J. Altice
|
||||
Volker Walkiewicz
|
||||
@@ -235,44 +203,37 @@ Tyge
|
||||
Troy Yee
|
||||
Tomas Hnilica
|
||||
Tino Schwarze
|
||||
Thomas Weidner
|
||||
Thom Carlo
|
||||
Tery Welsh
|
||||
Tatsuhiro Nishioka
|
||||
Tanguy Fautr<74>
|
||||
Steven Thomas
|
||||
Simon Hammett
|
||||
Sid Byce
|
||||
Shuxing Xiao
|
||||
Shane Arnott
|
||||
Sebastien Kuntz
|
||||
Ruth Lang
|
||||
Ruben Smelik
|
||||
Ross Anderson
|
||||
Ronny Krueger
|
||||
Robert Swain
|
||||
Rob Bloemkool
|
||||
Rick Pingry
|
||||
Rick Appleton
|
||||
Ricard Schmidt
|
||||
Rene Molenaar
|
||||
Reinhard Sainitzer
|
||||
Rein Kadijk
|
||||
Raymond de Vries
|
||||
Ragnar Hammarqvist
|
||||
Qing Shen
|
||||
Piotr Rak
|
||||
Philipp Siemoleit
|
||||
Philipp M<>chler
|
||||
Petr Salinger
|
||||
Paul Palumbo
|
||||
Paul Obermeier
|
||||
Paul Fredrikson
|
||||
Paul Fotheringham
|
||||
Patrick Hartling
|
||||
Parag Chaudhur
|
||||
Panagiotis Papadakos
|
||||
Panagiotis Koutsourakis
|
||||
Orhun Birsoy
|
||||
Ole-Morten Duesund
|
||||
Nicolas Brodu
|
||||
Neil Hughes
|
||||
Nathan Cournia
|
||||
Morten Haukness
|
||||
Morn<EFBFBD> Pistorius
|
||||
Mirko Viviani
|
||||
Mikkel Gjøl
|
||||
Mike Garrity
|
||||
@@ -280,59 +241,53 @@ Michael Polak
|
||||
Michael Morrison
|
||||
Michael Logan
|
||||
Max Rhiener
|
||||
Max Behensky
|
||||
Mauricio Hofmam
|
||||
Matthew May
|
||||
Matt Green
|
||||
Matt Burke
|
||||
Mathia Walker
|
||||
Mason Menninger
|
||||
Martins Innus
|
||||
Martin Spott
|
||||
Martin Amueller
|
||||
Mario Guimaraes
|
||||
Marin Lavery
|
||||
Marco Lehmann
|
||||
Marcin Prus
|
||||
Maciej Krol
|
||||
Lukas Diduch
|
||||
Louis Hamilton
|
||||
Lilin Xiong
|
||||
Lewis Harmon
|
||||
Lars Nilson
|
||||
Kyle Centers
|
||||
Kristopher Bixler
|
||||
Karsten Weiss
|
||||
Karl Heijdenberg
|
||||
Jutta Sauer
|
||||
Julian Scheid
|
||||
Josh Portway
|
||||
John Vidar Larring
|
||||
John Tan
|
||||
John Grant
|
||||
John Donovan
|
||||
John Davis
|
||||
John Argentieri
|
||||
Joan Abadie
|
||||
Jeroen den Dekker
|
||||
Jean-Christophe Lombardo
|
||||
Jay Zuckerman
|
||||
Jason Howlett
|
||||
Jason Ballenger
|
||||
J.E. Hoffmann
|
||||
Humar Carmona
|
||||
Henrique Bucher
|
||||
He Sicong
|
||||
Hautio Jari
|
||||
Guillaume Millet
|
||||
Graeme Harkness
|
||||
Glen Waldron
|
||||
Gian Lorenzetto
|
||||
George Papagiannakis
|
||||
Gary Quinn
|
||||
Galen Faidley
|
||||
Frederic Bouvier
|
||||
Frashid Lashkari
|
||||
Frank Warmerdam
|
||||
Frank Midgley
|
||||
Frank Lindeman
|
||||
Frank Lichtenheld
|
||||
Ferdinand Cornelissen
|
||||
Fajran Iman
|
||||
Fabien Dachicourt
|
||||
Emmanuel Roche
|
||||
Edmond Gheury
|
||||
Ed Ralston
|
||||
Duvan Cope
|
||||
@@ -342,15 +297,14 @@ Douglas A. Pouk
|
||||
Dean Iverson
|
||||
David Jung
|
||||
David Gurhrie
|
||||
Danny Valente
|
||||
Daniel Stien
|
||||
Daniel Olivier
|
||||
Dan Minor
|
||||
Cyril Brulebois
|
||||
Cory Riddell
|
||||
Clay Fowler
|
||||
Chuck Sembroski
|
||||
Chuck Seberion
|
||||
Christopher Blaesius
|
||||
Christophe Loustaunau
|
||||
Christian Kaser
|
||||
Chris McGlone
|
||||
Carlos Garcea
|
||||
@@ -358,13 +312,11 @@ Bruno Herbelin
|
||||
Brian Keener
|
||||
Brandon Hamm
|
||||
Bora Utka
|
||||
Bj<EFBFBD>rn Hein
|
||||
Bill Prendergast
|
||||
Blasius Czink
|
||||
Benoit Laniel
|
||||
Ben van Basten
|
||||
Bart Gallet
|
||||
Axel Volley
|
||||
Andy Preece
|
||||
Andrew Reyonolds
|
||||
Andreas Jochens
|
||||
Andre Normann
|
||||
@@ -375,5 +327,4 @@ Alberto Jaspe
|
||||
Alan Purvis
|
||||
Alan Ott
|
||||
Alan Harris
|
||||
Alan Dickinson
|
||||
Adam Richard
|
||||
|
||||
484
CMakeLists.txt
484
CMakeLists.txt
@@ -1,10 +1,11 @@
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||
|
||||
IF(WIN32)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
||||
ELSE(WIN32)
|
||||
IF(APPLE)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
|
||||
MESSAGE("Warning: A critical CMake bug exists in 2.4.6 and below. Trying to build Universal Binaries will result in a compile error that seems unrelated. Either avoid building Universal Binaries by changing the CMAKE_OSX_ARCHITECTURES field to list only your architecture, or upgrade to the current CVS version of CMake or a newer stable version if it exists.")
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
|
||||
ELSE(APPLE)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
|
||||
ENDIF(APPLE)
|
||||
@@ -18,24 +19,14 @@ if(COMMAND cmake_policy)
|
||||
# Works around warnings about escaped quotes in ADD_DEFINITIONS
|
||||
# statements.
|
||||
cmake_policy(SET CMP0005 NEW)
|
||||
|
||||
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
||||
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
|
||||
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
||||
cmake_policy(SET CMP0008 OLD)
|
||||
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 8)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 65)
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
# svn tags will be treated as release candidates of given number
|
||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 44)
|
||||
|
||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||
|
||||
@@ -62,6 +53,16 @@ SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR})
|
||||
# Maybe this can be used override existing behavior if needed?
|
||||
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
||||
|
||||
# Mainly for Windows as a convenience. This will find a directory in parallel with the
|
||||
# OSG source that contains 3rd party headers and libraries.
|
||||
# Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case
|
||||
#SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
|
||||
#SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
|
||||
IF(USING_OSG_OP_OT_TRIPLE_SET)
|
||||
SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}")
|
||||
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
|
||||
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)
|
||||
|
||||
|
||||
# Okay, here's the problem: On some platforms, linking against OpenThreads
|
||||
# is not enough and explicit linking to the underlying thread library
|
||||
@@ -80,65 +81,6 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "")
|
||||
ENDIF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
|
||||
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
||||
IF (OSG_MAINTAINER)
|
||||
|
||||
#SET(OPENSCENEGRAPH_SVN "trunk")
|
||||
SET(OPENSCENEGRAPH_SVN "branches")
|
||||
|
||||
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
||||
|
||||
#
|
||||
# Provide target for tagging a release
|
||||
#
|
||||
SET(SVNCOMMAND svn)
|
||||
SET(SVNTRUNKDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk)
|
||||
SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags)
|
||||
SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches)
|
||||
|
||||
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
|
||||
ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||
SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH})
|
||||
ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||
|
||||
|
||||
IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
|
||||
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION})
|
||||
ELSE (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
|
||||
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE})
|
||||
ENDIF(OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
|
||||
|
||||
|
||||
ADD_CUSTOM_TARGET(tag-test
|
||||
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(tag-run
|
||||
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(branch-test
|
||||
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(branch-run
|
||||
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}"
|
||||
)
|
||||
|
||||
#
|
||||
# Provide target for generating ChangeLog
|
||||
#
|
||||
SET(GENERATELOGS svn2cl)
|
||||
|
||||
ADD_CUSTOM_TARGET(ChangeLog
|
||||
COMMAND ${SVNCOMMAND} update
|
||||
COMMAND ${GENERATELOGS} ${SVNSOURCEDIR}
|
||||
)
|
||||
|
||||
ENDIF(OSG_MAINTAINER)
|
||||
|
||||
|
||||
# Find OpenGL
|
||||
FIND_PACKAGE(OpenGL)
|
||||
|
||||
@@ -180,11 +122,6 @@ IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ENDIF(WIN32_USE_MP)
|
||||
|
||||
# turn off various warnings
|
||||
# foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
|
||||
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}")
|
||||
# endforeach(warning)
|
||||
|
||||
# More MSVC specific compilation flags
|
||||
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
@@ -197,7 +134,7 @@ IF(WIN32)
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
ENDIF(UNIX)
|
||||
########################################################################################################
|
||||
# the following options are MSVC specific,
|
||||
# the foolowing options are MSVC specific,
|
||||
# the first OSG_MSVC_VERSIONED_DLL activate a custom build-time layout that should allow to run examples and application
|
||||
# fron bin folder without requiring installation step.
|
||||
# it also prepend "osg${OPENSCENEGRAPH_SOVERSION}-" to only .dll files, leaving .lib files untouched in lib
|
||||
@@ -257,15 +194,6 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
|
||||
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
|
||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
|
||||
|
||||
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
|
||||
|
||||
OPTION(OSG_DISABLE_MSVC_WARNINGS "Set to OFF to not disable MSVC warnings generated by OSG headers." ON)
|
||||
MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS)
|
||||
|
||||
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
|
||||
|
||||
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
||||
|
||||
################################################################################
|
||||
# Set Config file
|
||||
@@ -276,15 +204,6 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in"
|
||||
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
|
||||
|
||||
|
||||
################################################################################
|
||||
# Optional build components
|
||||
|
||||
# OSG Applications
|
||||
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
|
||||
|
||||
# OSG Examples
|
||||
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
|
||||
|
||||
################################################################################
|
||||
# 3rd Party Dependency Stuff
|
||||
IF(WIN32)
|
||||
@@ -293,26 +212,42 @@ ENDIF(WIN32)
|
||||
|
||||
# Common to all platforms:
|
||||
FIND_PACKAGE(FreeType)
|
||||
FIND_PACKAGE(FLTK)
|
||||
FIND_PACKAGE(GLUT)
|
||||
FIND_PACKAGE(SDL)
|
||||
FIND_PACKAGE(FOX)
|
||||
FIND_PACKAGE(Inventor)
|
||||
FIND_PACKAGE(Jasper)
|
||||
FIND_PACKAGE(OpenEXR)
|
||||
FIND_PACKAGE(COLLADA)
|
||||
FIND_PACKAGE(FBX)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(Xine)
|
||||
FIND_PACKAGE(OpenVRML)
|
||||
FIND_PACKAGE(Performer)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(GDAL)
|
||||
FIND_PACKAGE(CURL)
|
||||
FIND_PACKAGE(ITK)
|
||||
FIND_PACKAGE(LibVNCServer)
|
||||
FIND_PACKAGE(OurDCMTK)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
FIND_PACKAGE(XUL)
|
||||
FIND_PACKAGE(FFmpeg)
|
||||
|
||||
# Include macro utilities here
|
||||
INCLUDE(OsgMacroUtils)
|
||||
SET(wxWidgets_USE_LIBS base core gl net)
|
||||
FIND_PACKAGE(wxWidgets)
|
||||
|
||||
# To select a specific version of QT define DESIRED_QT_VERSION
|
||||
# via cmake -DDESIRED_QT_VERSION=4
|
||||
IF (DESIRED_QT_VERSION)
|
||||
|
||||
IF (DESIRED_QT_VERSION MATCHES 4)
|
||||
FIND_PACKAGE(Qt4)
|
||||
ELSE(DESIRED_QT_VERSION MATCHES 4)
|
||||
FIND_PACKAGE(Qt3)
|
||||
ENDIF(DESIRED_QT_VERSION MATCHES 4)
|
||||
|
||||
ELSE(DESIRED_QT_VERSION)
|
||||
|
||||
FIND_PACKAGE(Qt4)
|
||||
|
||||
IF (NOT QT4_FOUND)
|
||||
FIND_PACKAGE(Qt3)
|
||||
ENDIF(NOT QT4_FOUND)
|
||||
|
||||
ENDIF(DESIRED_QT_VERSION)
|
||||
|
||||
#use pkg-config to find various modues
|
||||
INCLUDE(FindPkgConfig OPTIONAL)
|
||||
@@ -331,49 +266,9 @@ IF(PKG_CONFIG_FOUND)
|
||||
|
||||
PKG_CHECK_MODULES(RSVG librsvg-2.0)
|
||||
PKG_CHECK_MODULES(CAIRO cairo)
|
||||
PKG_CHECK_MODULES(POPPLER poppler-glib)
|
||||
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
#optional example related dependencies
|
||||
IF (BUILD_OSG_EXAMPLES)
|
||||
|
||||
|
||||
FIND_PACKAGE(FLTK)
|
||||
FIND_PACKAGE(GLUT)
|
||||
FIND_PACKAGE(SDL)
|
||||
FIND_PACKAGE(FOX)
|
||||
|
||||
SET(wxWidgets_USE_LIBS base core gl net)
|
||||
FIND_PACKAGE(wxWidgets)
|
||||
|
||||
# To select a specific version of QT define DESIRED_QT_VERSION
|
||||
# via cmake -DDESIRED_QT_VERSION=4
|
||||
IF (DESIRED_QT_VERSION)
|
||||
|
||||
IF (DESIRED_QT_VERSION MATCHES 4)
|
||||
FIND_PACKAGE(Qt4)
|
||||
ELSE(DESIRED_QT_VERSION MATCHES 4)
|
||||
FIND_PACKAGE(Qt3)
|
||||
ENDIF(DESIRED_QT_VERSION MATCHES 4)
|
||||
|
||||
ELSE(DESIRED_QT_VERSION)
|
||||
|
||||
FIND_PACKAGE(Qt4)
|
||||
|
||||
IF (NOT QT4_FOUND)
|
||||
FIND_PACKAGE(Qt3)
|
||||
ENDIF(NOT QT4_FOUND)
|
||||
|
||||
ENDIF(DESIRED_QT_VERSION)
|
||||
|
||||
ENDIF(BUILD_OSG_EXAMPLES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Test to determine if we want the "tripledot" form of the GLU tesselator callback.
|
||||
#
|
||||
@@ -407,7 +302,7 @@ IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||
ENDIF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||
|
||||
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
|
||||
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
|
||||
IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
|
||||
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||
@@ -453,19 +348,17 @@ ENDIF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
# Installation stuff
|
||||
|
||||
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
|
||||
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
IF(UNIX AND NOT WIN32)
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX="${CMAKE_DEBUG_POSTFIX}")
|
||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX='\"${CMAKE_DEBUG_POSTFIX}\"')
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ADD_DEFINITIONS("-D_DEBUG")
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ENDIF(UNIX AND NOT WIN32)
|
||||
ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
|
||||
IF(CYGWIN)
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ADD_DEFINITIONS("-D_DEBUG")
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ENDIF(CYGWIN)
|
||||
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
@@ -499,16 +392,8 @@ ENDIF(NOT MSVC)
|
||||
#
|
||||
# On CMake 2.6.x use the newly minted CMAKE_LIBRARY_OUTPUT_DIRECTORY,
|
||||
# CMAKE_ARCHIVE_OUTPUT_DIRECTORY & CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
#
|
||||
# CMake >= 2.8.1 changed the output directory algorithm (See doc).
|
||||
# Here we also set per-configuration directories (CMAKE_*_OUTPUT_DIRECTORY_<CONFIG>), or else binaries are generated in /bin/Debug and /bin/Release, etc. with MSVC and Xcode.
|
||||
# (Doc reads "multi-configuration generators (VS, Xcode) do NOT append a per-configuration subdirectory to the specified directory").
|
||||
# The workaround for 2.6.x (adding "../" as an output prefix for each target) seem to have no effect in >=2.8.1, so there is no need to change this.
|
||||
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 5)
|
||||
# If CMake < 2.6.0
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
|
||||
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
|
||||
ELSE()
|
||||
|
||||
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
# If CMake >= 2.6.0
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
|
||||
@@ -517,22 +402,10 @@ ELSE()
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Testing CMAKE_VERSION is possible in >= 2.6.4 only
|
||||
BUILDER_VERSION_GREATER(2 8 0)
|
||||
IF(VALID_BUILDER_VERSION) # If CMake >= 2.8.1
|
||||
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES}) # For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
|
||||
STRING(TOUPPER "${CONF}" CONF) # Go uppercase (DEBUG, RELEASE...)
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
|
||||
IF(WIN32)
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
|
||||
ELSE()
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDIF(VALID_BUILDER_VERSION)
|
||||
ENDIF()
|
||||
ELSE(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
|
||||
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
|
||||
ENDIF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
|
||||
#SET(INSTALL_BINDIR OpenSceneGraph/bin)
|
||||
#SET(INSTALL_INCDIR OpenSceneGraph/include)
|
||||
@@ -563,6 +436,31 @@ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} CACHE STRING "You may add additiona
|
||||
# This is unofficial so this may be removed or changed at anytime.
|
||||
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "(EXPERIMENTAL) You may add additional search paths here. Use ; to separate multiple paths.")
|
||||
|
||||
|
||||
# Dynamic vs Static Linking
|
||||
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
|
||||
IF (DYNAMIC_OPENSCENEGRAPH)
|
||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
|
||||
ELSE (DYNAMIC_OPENSCENEGRAPH)
|
||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
INCLUDE(OsgMacroUtils)
|
||||
# OSG Core
|
||||
ADD_SUBDIRECTORY(src)
|
||||
|
||||
# OSG Applications
|
||||
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
|
||||
IF (BUILD_OSG_APPLICATIONS)
|
||||
ADD_SUBDIRECTORY(applications)
|
||||
ENDIF(BUILD_OSG_APPLICATIONS)
|
||||
|
||||
# OSG Examples
|
||||
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
|
||||
IF (BUILD_OSG_EXAMPLES)
|
||||
ADD_SUBDIRECTORY(examples)
|
||||
ENDIF(BUILD_OSG_EXAMPLES)
|
||||
|
||||
# This is for an advanced option to give aggressive warnings
|
||||
# under different compilers. If yours is not implemented, this option
|
||||
# will not be made available.
|
||||
@@ -577,17 +475,13 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# errors instead of warnings for certain issues, including superfluous
|
||||
# semicolons and commas, and the use of long long. -fpermissive seems
|
||||
# to be the workaround.
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive)
|
||||
|
||||
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
|
||||
|
||||
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS "-Wall -Wparentheses -Wformat=2 -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive")
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
IF(MSVC)
|
||||
# FIXME: What are good aggressive warning flags for Visual Studio?
|
||||
# And do we need to further subcase this for different versions of VS?
|
||||
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS "/Wall /W4")
|
||||
|
||||
|
||||
ELSE(MSVC)
|
||||
@@ -600,53 +494,26 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# This part is for the CMake menu option to toggle the warnings on/off.
|
||||
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
|
||||
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
||||
|
||||
IF (APPLE)
|
||||
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS OFF)
|
||||
ELSE(APPLE)
|
||||
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS ON)
|
||||
ENDIF(APPLE)
|
||||
|
||||
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS})
|
||||
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||
|
||||
IF(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||
# Add flags defined by OSG_AGGRESSIVE_WARNING_FLAGS if they aren't already there
|
||||
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
|
||||
IF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
|
||||
ENDFOREACH(flag)
|
||||
IF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
||||
SET(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "Old CXX flags")
|
||||
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 1 CACHE INTERNAL "Old CXX flags was set")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSG_AGGRESSIVE_WARNING_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ENDIF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
||||
ELSE(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||
# Remove all flags considered aggresive
|
||||
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
|
||||
STRING(REGEX REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDFOREACH(flag)
|
||||
# FIXME: This will lose any changes made after OLD_CMAKE_CXX_FLAGS was
|
||||
# set. The better way would be to parse the string and remove each
|
||||
# option explicitly.
|
||||
IF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
||||
SET(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 0 CACHE INTERNAL "Old CXX flags was set")
|
||||
ENDIF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
||||
ENDIF(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||
ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
||||
|
||||
|
||||
# Dynamic vs Static Linking
|
||||
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
|
||||
IF (DYNAMIC_OPENSCENEGRAPH)
|
||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
|
||||
ELSE (DYNAMIC_OPENSCENEGRAPH)
|
||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
|
||||
# OSG Core
|
||||
ADD_SUBDIRECTORY(src)
|
||||
|
||||
IF (BUILD_OSG_APPLICATIONS)
|
||||
ADD_SUBDIRECTORY(applications)
|
||||
ENDIF(BUILD_OSG_APPLICATIONS)
|
||||
|
||||
IF (BUILD_OSG_EXAMPLES)
|
||||
ADD_SUBDIRECTORY(examples)
|
||||
ENDIF(BUILD_OSG_EXAMPLES)
|
||||
|
||||
|
||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||
IF(APPLE)
|
||||
@@ -684,35 +551,32 @@ IF(APPLE)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
OPTION(BUILD_REF_DOCS "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
|
||||
|
||||
#
|
||||
# Provide target for generating wrappers
|
||||
#
|
||||
SET(GENWRAPPER genwrapper)
|
||||
|
||||
ADD_CUSTOM_TARGET(wrappers
|
||||
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -t ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/Doxyfile.template -d ${OpenSceneGraph_SOURCE_DIR} | doxygen -
|
||||
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -l ${OpenSceneGraph_SOURCE_DIR}
|
||||
)
|
||||
IF(BUILD_REF_DOCS)
|
||||
SET(BUILD_DOCUMENTATION YES)
|
||||
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
||||
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
|
||||
ENDIF(BUILD_REF_DOCS)
|
||||
|
||||
# For Doxygen
|
||||
#FIXME: I haven't figured out what to do with OSG's multiple doxyfiles
|
||||
# and footer.
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
||||
OPTION(BUILD_DOCUMENTATION "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
|
||||
MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
|
||||
OPTION(BUILD_DOCUMENTATION "Build osg documentation" OFF)
|
||||
# To build the documention, you will have to enable it
|
||||
# and then do the equivalent of "make DoxygenDoc".
|
||||
IF(BUILD_DOCUMENTATION)
|
||||
SET(BUILD_DOCUMENTATION YES)
|
||||
|
||||
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
||||
IF(BUILD_REF_DOCS_SEARCHENGINE)
|
||||
SET(SEARCHENGINE YES)
|
||||
ELSE(BUILD_REF_DOCS_SEARCHENGINE)
|
||||
SET(SEARCHENGINE NO)
|
||||
ENDIF(BUILD_REF_DOCS_SEARCHENGINE)
|
||||
|
||||
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
|
||||
IF(BUILD_REF_DOCS_TAGFILE)
|
||||
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg.tag")
|
||||
SET(GENERATE_TAGFILE "doc/OpenSceneGraphReferenceDocs/osg.tag")
|
||||
ELSE(BUILD_REF_DOCS_TAGFILE)
|
||||
SET(GENERATE_TAGFILE "")
|
||||
ENDIF(BUILD_REF_DOCS_TAGFILE)
|
||||
@@ -722,148 +586,29 @@ IF(BUILD_DOCUMENTATION)
|
||||
ELSE(DOT)
|
||||
SET(HAVE_DOT NO)
|
||||
ENDIF(DOT)
|
||||
|
||||
# If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
|
||||
SET(GENERATE_HTMLHELP "NO")
|
||||
IF(DOCUMENTATION_HTML_HELP)
|
||||
# on windows Documentation.cmake finds the html help workshop fi it exists. On u*ix we might have it with wine but no way to point it out
|
||||
IF(NOT WIN32)
|
||||
SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
|
||||
MARK_AS_ADVANCED(HTML_HELP_COMPILER)
|
||||
ENDIF(NOT WIN32)
|
||||
# this var sets a proper value in .doxygen files when coniguring them below
|
||||
SET(GENERATE_HTMLHELP "YES")
|
||||
endif(DOCUMENTATION_HTML_HELP)
|
||||
|
||||
# This processes our doxyfile.cmake and substitutes paths to generate
|
||||
# This processes our Doxyfile.in and substitutes paths to generate
|
||||
# a final Doxyfile
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake
|
||||
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
|
||||
${PROJECT_BINARY_DIR}/doc/doxyfile
|
||||
)
|
||||
# copy the osg logo to documentations target folder
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
|
||||
${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg32-32.png COPYONLY
|
||||
)
|
||||
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
|
||||
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs DESTINATION doc COMPONENT openscenegraph-doc)
|
||||
|
||||
# now set up openthreads documentation generation
|
||||
IF(BUILD_REF_DOCS_TAGFILE)
|
||||
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenThreadsReferenceDocs/ot.tag")
|
||||
ENDIF(BUILD_REF_DOCS_TAGFILE)
|
||||
|
||||
# This processes our openthreads.doxyfile.cmake and generate a final doxyfile
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/openthreads.doxyfile.cmake
|
||||
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
|
||||
)
|
||||
# copy the osg logo to documentations target folder
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
|
||||
${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs/osg32-32.png COPYONLY
|
||||
)
|
||||
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
|
||||
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs DESTINATION doc COMPONENT openthreads-doc)
|
||||
|
||||
# Process our other doxyfiles but don't create targets for these
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/all_Doxyfile
|
||||
${PROJECT_BINARY_DIR}/doc/all_Doxyfile)
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/auto_Doxyfile
|
||||
${PROJECT_BINARY_DIR}/doc/auto_Doxyfile)
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/core_Doxyfile
|
||||
${PROJECT_BINARY_DIR}/doc/core_Doxyfile)
|
||||
|
||||
# This creates a new target to build documentation.
|
||||
# It runs ${DOXYGEN} which is the full path and executable to
|
||||
# Doxygen on your system, set by the FindDoxygen.cmake module
|
||||
# (called by FindDocumentation.cmake).
|
||||
# It runs the final generated Doxyfile against it.
|
||||
# The DOT_PATH is substituted into the Doxyfile.
|
||||
ADD_CUSTOM_TARGET(doc_openscenegraph ${DOXYGEN}
|
||||
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
|
||||
)
|
||||
ADD_CUSTOM_TARGET(doc_openthreads ${DOXYGEN}
|
||||
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
|
||||
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN}
|
||||
${PROJECT_BINARY_DIR}/doc/doxyfile
|
||||
)
|
||||
ENDIF(BUILD_DOCUMENTATION)
|
||||
|
||||
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of OpenSceneGraph builds here http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph" OFF)
|
||||
IF(BUILD_DASHBOARD_REPORTS)
|
||||
# The following are required to uses Dart and the Cdash dashboard
|
||||
# viewable here : http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph
|
||||
INCLUDE(Dart)
|
||||
ENDIF(BUILD_DASHBOARD_REPORTS)
|
||||
|
||||
# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0)
|
||||
IF(CMAKE_CPACK_COMMAND)
|
||||
OPTION(BUILD_OSG_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
|
||||
IF(BUILD_OSG_PACKAGES)
|
||||
INCLUDE(OsgCPack)
|
||||
ENDIF(BUILD_OSG_PACKAGES)
|
||||
ENDIF(CMAKE_CPACK_COMMAND)
|
||||
|
||||
# Generate pkg-config configuration file
|
||||
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/openscenegraph.pc.in
|
||||
${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc
|
||||
@ONLY
|
||||
)
|
||||
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig COMPONENT libopenscenegraph-dev)
|
||||
|
||||
# Run this as late as possible so users can easier spot the message
|
||||
IF (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
|
||||
SET(REQUIRES_LIBPATH_MESSAGE ON)
|
||||
ENDIF(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
|
||||
|
||||
IF(REQUIRES_LIBPATH_MESSAGE)
|
||||
|
||||
IF (NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
|
||||
|
||||
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
|
||||
|
||||
MESSAGE("\nThe build system is configured to instal libraries to ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}\n"
|
||||
"Your applications may not be able to find your installed libraries unless you:\n"
|
||||
" set your LD_LIBRARY_PATH (user specific) or\n"
|
||||
" update your ld.so configuration (system wide)")
|
||||
IF(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||
MESSAGE("You have an ld.so.conf.d directory on your system, so if you wish to ensure that\n"
|
||||
"applications find the installed osg libraries, system wide, you could install a\n"
|
||||
"openscenegraph specific ld.so configuration with:\n"
|
||||
" sudo make install_ld_conf\n")
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/ld.so.conf.d/openscenegraph.conf.in
|
||||
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
|
||||
)
|
||||
ADD_CUSTOM_TARGET(install_ld_conf ${CMAKE_COMMAND} -E copy_if_different
|
||||
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
|
||||
/etc/ld.so.conf.d/openscenegraph.conf
|
||||
COMMAND ldconfig
|
||||
COMMENT "Copying openscenegraph.conf to /etc/ld.so.conf.d and running ldconfig"
|
||||
)
|
||||
ELSE(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||
IF(EXISTS /etc/ld.so.conf)
|
||||
MESSAGE("You have an ld.so.conf file in /etc, if you wish to ensure \n"
|
||||
"that applications find the installed osg libraries, system wide, you\n"
|
||||
"could add ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX} to it.")
|
||||
ENDIF(EXISTS /etc/ld.so.conf)
|
||||
ENDIF(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||
|
||||
# emit a message during installation.
|
||||
INSTALL(CODE "MESSAGE(\"Libraries were installed to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}.\\nYou may need to update your ld.so configuration. \")")
|
||||
|
||||
ENDIF(NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
|
||||
|
||||
ELSE(REQUIRES_LIBPATH_MESSAGE)
|
||||
|
||||
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 0 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
|
||||
|
||||
ENDIF(REQUIRES_LIBPATH_MESSAGE)
|
||||
|
||||
|
||||
# This needs to be run very last so other parts of the scripts can take
|
||||
# advantage of this.
|
||||
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
### uninstall target
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -873,3 +618,4 @@ CONFIGURE_FILE(
|
||||
IMMEDIATE @ONLY)
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
|
||||
@@ -68,13 +68,8 @@ int main(int, const char**)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <windows.h>
|
||||
#include <intrin.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#pragma intrinsic(_InterlockedAnd)
|
||||
#pragma intrinsic(_InterlockedOr)
|
||||
#pragma intrinsic(_InterlockedXor)
|
||||
|
||||
int main(int, const char**)
|
||||
{
|
||||
volatile long value = 0;
|
||||
@@ -95,24 +90,6 @@ int main(int, const char**)
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <libkern/OSAtomic.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
volatile int32_t value = 0;
|
||||
long data = 0;
|
||||
long * volatile ptr = &data;
|
||||
|
||||
OSAtomicIncrement32(&value);
|
||||
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)
|
||||
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)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||
ENDIF(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)
|
||||
ENDIF(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)
|
||||
|
||||
@@ -55,13 +55,12 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGS
|
||||
|
||||
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D")
|
||||
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235;freetype237" ${OSG_3RDPARTY_BIN} "_D")
|
||||
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235" ${OSG_3RDPARTY_BIN} "_D")
|
||||
IF(FREETYPE_FOUND)
|
||||
#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_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
|
||||
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
|
||||
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
|
||||
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
||||
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
ENDIF(FREETYPE_FOUND)
|
||||
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D")
|
||||
FIND_DEPENDENCY(JPEG jpeglib.h libjpeg ${OSG_3RDPARTY_BIN} "D")
|
||||
|
||||
@@ -1,33 +1,15 @@
|
||||
# Locate Collada
|
||||
# This module defines:
|
||||
# Locate gdal
|
||||
# This module defines
|
||||
# COLLADA_LIBRARY
|
||||
# COLLADA_FOUND, if false, do not try to link to gdal
|
||||
# COLLADA_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# COLLADA_LIBRARY, COLLADA_LIBRARY_DEBUG
|
||||
# COLLADA_FOUND, if false, do not try to link to Collada dynamically
|
||||
#
|
||||
# COLLADA_LIBRARY_STATIC, COLLADA_LIBRARY_STATIC_DEBUG
|
||||
# COLLADA_STATIC_FOUND, if false, do not try to link to Collada statically
|
||||
#
|
||||
# $COLLADA_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$COLLADA_DIR
|
||||
#
|
||||
# Created by Robert Osfield.
|
||||
|
||||
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory")
|
||||
|
||||
IF(APPLE)
|
||||
SET(COLLADA_BUILDNAME "mac")
|
||||
ELSEIF(MINGW)
|
||||
SET(COLLADA_BUILDNAME "mingw")
|
||||
ELSEIF(MSVC90)
|
||||
SET(COLLADA_BUILDNAME "vc9")
|
||||
ELSE(APPLE)
|
||||
SET(COLLADA_BUILDNAME "vc8")
|
||||
ENDIF(APPLE)
|
||||
|
||||
|
||||
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
||||
${COLLADA_DOM_ROOT}/include
|
||||
$ENV{COLLADA_DIR}/include
|
||||
$ENV{COLLADA_DIR}
|
||||
$ENV{OSGDIR}/include
|
||||
@@ -47,11 +29,9 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
||||
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
|
||||
FIND_LIBRARY(COLLADA_LIBRARY
|
||||
NAMES collada_dom collada14dom
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
||||
$ENV{COLLADA_DIR}/lib
|
||||
$ENV{COLLADA_DIR}/lib-dbg
|
||||
$ENV{COLLADA_DIR}
|
||||
@@ -72,189 +52,9 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
|
||||
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||
$ENV{COLLADA_DIR}/lib
|
||||
$ENV{COLLADA_DIR}/lib-dbg
|
||||
$ENV{COLLADA_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/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;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_STATIC_LIBRARY
|
||||
NAMES libcollada14dom21-s libcollada14dom22-s
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
||||
$ENV{COLLADA_DIR}/lib
|
||||
$ENV{COLLADA_DIR}/lib-dbg
|
||||
$ENV{COLLADA_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/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;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||
NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd libcollada14dom22-sd
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||
$ENV{COLLADA_DIR}/lib
|
||||
$ENV{COLLADA_DIR}/lib-dbg
|
||||
$ENV{COLLADA_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/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;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
# find extra libraries that the static linking requires
|
||||
|
||||
FIND_PACKAGE(LibXml2)
|
||||
IF (LIBXML2_FOUND)
|
||||
SET(COLLADA_LIBXML_LIBRARY ${LIBXML2_LIBRARIES})
|
||||
ELSE(LIBXML2_FOUND)
|
||||
IF(WIN32)
|
||||
FIND_LIBRARY(COLLADA_LIBXML_LIBRARY
|
||||
NAMES libxml2
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
|
||||
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(LIBXML2_FOUND)
|
||||
|
||||
FIND_PACKAGE(ZLIB)
|
||||
IF (ZLIB_FOUND)
|
||||
SET(COLLADA_ZLIB_LIBRARY ${ZLIB_LIBRARY})
|
||||
ELSE(ZLIB_FOUND)
|
||||
IF(WIN32)
|
||||
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
|
||||
NAMES zlib
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
|
||||
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(ZLIB_FOUND)
|
||||
|
||||
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY
|
||||
NAMES pcrecpp
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY_DEBUG
|
||||
NAMES pcrecpp-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_PCRE_LIBRARY
|
||||
NAMES pcre
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_PCRE_LIBRARY_DEBUG
|
||||
NAMES pcre-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY
|
||||
NAMES minizip
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
|
||||
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY_DEBUG
|
||||
NAMES minizip-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
|
||||
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
|
||||
NAMES libboost_filesystem boost_filesystem
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
|
||||
NAMES libboost_filesystem-d boost_filesystem-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
|
||||
NAMES libboost_system boost_system
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
|
||||
NAMES libboost_system-d boost_system-d
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
)
|
||||
|
||||
|
||||
SET(COLLADA_FOUND "NO")
|
||||
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||
IF (COLLADA_INCLUDE_DIR)
|
||||
SET(COLLADA_FOUND "YES")
|
||||
ENDIF(COLLADA_INCLUDE_DIR)
|
||||
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||
IF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
|
||||
SET(COLLADA_FOUND "YES")
|
||||
ENDIF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
|
||||
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
# Locate FBX
|
||||
# This module defines:
|
||||
# FBX_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# FBX_LIBRARY, FBX_LIBRARY_DEBUG
|
||||
# FBX_FOUND
|
||||
#
|
||||
# $FBX_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$FBX_DIR
|
||||
|
||||
IF(WIN32)
|
||||
SET(FBX_ROOT "$ENV{PROGRAMFILES}/Autodesk/FBX/FbxSdk/2010.2" CACHE PATH "Location of FBX SDK directory")
|
||||
ELSE(WIN32)
|
||||
SET(FBX_ROOT $ENV{FBX_DIR} CACHE PATH "Location of FBX SDK directory")
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(APPLE)
|
||||
SET(FBX_LIBNAME "libfbxsdk_gcc4_ub")
|
||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(FBX_LIBNAME "libfbxsdk_gcc4")#TODO: libs are provided for GCC 3.4 & 4.0 in both 32 and 64 bit versions, but I don't know how to confgure that here.
|
||||
ELSEIF(MSVC71)
|
||||
SET(FBX_LIBNAME "fbxsdk_md2003")
|
||||
ELSEIF(MSVC80)
|
||||
SET(FBX_LIBNAME "fbxsdk_md2005")
|
||||
ELSEIF(MSVC90 OR MSVC_VER>1500)
|
||||
SET(FBX_LIBNAME "fbxsdk_md2008")
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(FBX_LIBNAME ${FBX_LIBNAME}_amd64)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
IF(APPLE)
|
||||
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME})
|
||||
ELSE(APPLE)
|
||||
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||
ENDIF(APPLE)
|
||||
|
||||
FIND_PATH(FBX_INCLUDE_DIR fbxsdk.h
|
||||
${FBX_ROOT}/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(FBX_LIBRARY ${FBX_LIBNAME} ${FBX_ROOT}/lib)
|
||||
|
||||
FIND_LIBRARY(FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG} ${FBX_ROOT}/lib)
|
||||
|
||||
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||
SET(FBX_FOUND "YES")
|
||||
ELSE(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||
SET(FBX_FOUND "NO")
|
||||
ENDIF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||
@@ -1,165 +0,0 @@
|
||||
# Locate ffmpeg
|
||||
# This module defines
|
||||
# FFMPEG_LIBRARIES
|
||||
# FFMPEG_FOUND, if false, do not try to link to ffmpeg
|
||||
# FFMPEG_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $FFMPEG_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$FFMPEG_DIR
|
||||
#
|
||||
# Created by Robert Osfield.
|
||||
|
||||
|
||||
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
|
||||
#In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg
|
||||
|
||||
#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 (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)
|
||||
# (in new version case, use by ffmpeg header)
|
||||
#and ${FFMPEG_libname_INCLUDE_DIRS/libname} (in new version case, use by osg plugin code)
|
||||
|
||||
|
||||
# Macro to find header and lib directories
|
||||
# example: FFMPEG_FIND(AVFORMAT avformat avformat.h)
|
||||
MACRO(FFMPEG_FIND varname shortname headername)
|
||||
# old version of ffmpeg put header in $prefix/include/[ffmpeg]
|
||||
# so try to find header in include directory
|
||||
|
||||
FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
|
||||
PATHS
|
||||
${FFMPEG_ROOT}/include
|
||||
$ENV{FFMPEG_DIR}/include
|
||||
~/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
|
||||
PATH_SUFFIXES ffmpeg
|
||||
DOC "Location of FFMPEG Headers"
|
||||
)
|
||||
|
||||
FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
|
||||
PATHS
|
||||
${FFMPEG_ROOT}/include
|
||||
$ENV{FFMPEG_DIR}/include
|
||||
~/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
|
||||
PATH_SUFFIXES ffmpeg
|
||||
DOC "Location of FFMPEG Headers"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
|
||||
NAMES ${shortname}
|
||||
PATHS
|
||||
${FFMPEG_ROOT}/lib
|
||||
$ENV{FFMPEG_DIR}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
DOC "Location of FFMPEG Libraries"
|
||||
)
|
||||
|
||||
IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
|
||||
SET(FFMPEG_${varname}_FOUND 1)
|
||||
ENDIF(FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
|
||||
|
||||
ENDMACRO(FFMPEG_FIND)
|
||||
|
||||
SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
|
||||
|
||||
# find stdint.h
|
||||
IF(WIN32)
|
||||
|
||||
FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
|
||||
PATHS
|
||||
${FFMPEG_ROOT}/include
|
||||
$ENV{FFMPEG_DIR}/include
|
||||
~/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
|
||||
PATH_SUFFIXES ffmpeg
|
||||
DOC "Location of FFMPEG stdint.h Header"
|
||||
)
|
||||
|
||||
IF (FFMPEG_STDINT_INCLUDE_DIR)
|
||||
SET(STDINT_OK TRUE)
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
|
||||
SET(STDINT_OK TRUE)
|
||||
|
||||
ENDIF()
|
||||
|
||||
FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
|
||||
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
|
||||
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
|
||||
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
|
||||
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
|
||||
|
||||
SET(FFMPEG_FOUND "NO")
|
||||
# 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)
|
||||
|
||||
SET(FFMPEG_FOUND "YES")
|
||||
|
||||
SET(FFMPEG_INCLUDE_DIRS
|
||||
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
|
||||
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
|
||||
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
|
||||
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil
|
||||
)
|
||||
|
||||
IF (${FFMPEG_STDINT_INCLUDE_DIR})
|
||||
SET(FFMPEG_INCLUDE_DIRS
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
${FFMPEG_STDINT_INCLUDE_DIR}
|
||||
${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
|
||||
${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
|
||||
${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec
|
||||
${FFMPEG_STDINT_INCLUDE_DIR}/libavutil
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
|
||||
SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})
|
||||
|
||||
# Note we don't add FFMPEG_LIBSWSCALE_LIBRARIES here, it will be added if found later.
|
||||
SET(FFMPEG_LIBRARIES
|
||||
${FFMPEG_LIBAVFORMAT_LIBRARIES}
|
||||
${FFMPEG_LIBAVDEVICE_LIBRARIES}
|
||||
${FFMPEG_LIBAVCODEC_LIBRARIES}
|
||||
${FFMPEG_LIBAVUTIL_LIBRARIES})
|
||||
|
||||
ELSE ()
|
||||
|
||||
# MESSAGE(STATUS "Could not find FFMPEG")
|
||||
|
||||
ENDIF()
|
||||
@@ -20,7 +20,6 @@
|
||||
# #include "gdal.h"
|
||||
|
||||
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
|
||||
PATHS
|
||||
$ENV{GDAL_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
PATH_SUFFIXES include
|
||||
|
||||
@@ -1,41 +1,10 @@
|
||||
#
|
||||
# Find Open Inventor
|
||||
#
|
||||
# - Locate Inventor
|
||||
# This module defines:
|
||||
# INVENTOR_FOUND, if false, do not try to link against Inventor.
|
||||
# INVENTOR_INCLUDE_DIR, where to find headers.
|
||||
# INVENTOR_LIBRARY, the library to link against.
|
||||
# INVENTOR_LIBRARY_DEBUG, the debug library to link against.
|
||||
# INVENTOR_SOWIN_LIBRARY, the SoWin library - window binding library for Inventor
|
||||
# INVENTOR_SOWIN_LIBRARY, the SoWin debug library
|
||||
# INVENTOR_SOXT_LIBRARY, the SoXt library - window binding library for Inventor
|
||||
# INVENTOR_SOXT_LIBRARY, the SoXt debug library
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Inventor
|
||||
#
|
||||
# notes:
|
||||
# - Coin is honored over SGI Inventor
|
||||
# - Coin is detected by coin-config script, COINDIR environment variable,
|
||||
# and finally standard system locations are searched
|
||||
# - SGI Inventor is searched at standard system locations only
|
||||
#
|
||||
|
||||
# coin-config tells much of Coin instalation (if present)
|
||||
execute_process (COMMAND coin-config --prefix
|
||||
OUTPUT_VARIABLE COIN_PREFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# try to find Inventor includes (priority paths)
|
||||
FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
||||
${COIN_PREFIX}/include
|
||||
$ENV{COINDIR}/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find Inventor includes (regular paths)
|
||||
FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
@@ -43,164 +12,52 @@ FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
$ENV{COINDIR}/include
|
||||
)
|
||||
|
||||
# default Inventor lib search paths
|
||||
SET(INVENTOR_LIB_SEARCH_PATH
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY
|
||||
NAMES coin2 Coin
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
$ENV{COINDIR}/lib
|
||||
)
|
||||
IF(NOT INVENTOR_LIBRARY)
|
||||
# If we can't find libCoin try libInventor
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY
|
||||
NAMES Inventor
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
)
|
||||
ENDIF(NOT INVENTOR_LIBRARY)
|
||||
|
||||
# try to find Coin release lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||
NAMES coin5 coin4 coin3 coin2 coin1 Coin
|
||||
PATHS ${COIN_PREFIX}/lib
|
||||
$ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find Coin release lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||
NAMES coin5 coin4 coin3 coin2 coin1 Coin
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# try to find SGI Inventor lib
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||
NAMES Inventor
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# try to find Coin debug lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG
|
||||
NAMES coin5d coin4d coin3d coin2d coin1d
|
||||
PATHS ${COIN_PREFIX}/lib
|
||||
$ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
NAMES coin2d
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
$ENV{COINDIR}/lib
|
||||
)
|
||||
IF(NOT INVENTOR_LIBRARY_DEBUG)
|
||||
IF(INVENTOR_LIBRARY)
|
||||
SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY})
|
||||
ENDIF(INVENTOR_LIBRARY)
|
||||
ENDIF(NOT INVENTOR_LIBRARY_DEBUG)
|
||||
|
||||
# try to find Coin debug lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG
|
||||
NAMES coin5d coin4d coin3d coin2d coin1d
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# set release to debug if only debug found
|
||||
IF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG)
|
||||
SET(INVENTOR_LIBRARY_RELEASE ${INVENTOR_LIBRARY_DEBUG})
|
||||
ENDIF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG)
|
||||
|
||||
# set debug to release (if only release found)
|
||||
IF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE)
|
||||
SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY_RELEASE})
|
||||
ENDIF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE)
|
||||
|
||||
# INVENTOR_LIBRARY
|
||||
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
SET(INVENTOR_LIBRARY
|
||||
optimized ${INVENTOR_LIBRARY_RELEASE}
|
||||
debug ${INVENTOR_LIBRARY_DEBUG})
|
||||
ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
SET(INVENTOR_LIBRARY
|
||||
${INVENTOR_LIBRARY_RELEASE})
|
||||
ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
|
||||
# set INVENTOR_FOUND appropriately
|
||||
SET(INVENTOR_FOUND "NO")
|
||||
IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
||||
SET(INVENTOR_FOUND "YES")
|
||||
ENDIF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
||||
|
||||
|
||||
#
|
||||
# SoWin
|
||||
#
|
||||
# notes: SoWin is searched by COINDIR environment variable
|
||||
# (as expected to be located at Windows platform)
|
||||
|
||||
# try to find SoWin lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY
|
||||
NAMES sowin1
|
||||
PATHS $ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find SoWin lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY
|
||||
NAMES sowin1
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# try to find SoWin debug lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG
|
||||
NAMES sowin1d
|
||||
PATHS $ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find SoWin debug lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG
|
||||
NAMES sowin1d
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# SoWin debug library defaults to non-debug lib
|
||||
IF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG)
|
||||
IF(INVENTOR_SOWIN_LIBRARY)
|
||||
SET(INVENTOR_SOWIN_LIBRARY_DEBUG INVENTOR_SOWIN_LIBRARY)
|
||||
ENDIF(INVENTOR_SOWIN_LIBRARY)
|
||||
ENDIF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG)
|
||||
|
||||
|
||||
#
|
||||
# SoXt
|
||||
#
|
||||
# notes:
|
||||
# - SoXt is detected by soxt-config script (as expected by
|
||||
# Coin's SoXt on Linux/Unix) and on standard system locations
|
||||
# - SGI's InventorXt support is missing now
|
||||
#
|
||||
|
||||
# soxt-config tells much of SoXt instalation (if present)
|
||||
execute_process (COMMAND soxt-config --prefix
|
||||
OUTPUT_VARIABLE SOXT_PREFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# try to find SoXt lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY
|
||||
NAMES soxt1 SoXt
|
||||
PATHS ${SOXT_PREFIX}/lib
|
||||
$ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find SoXt lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY
|
||||
NAMES soxt1 SoXt
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# try to find SoXt debug lib (priority paths)
|
||||
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG
|
||||
NAMES soxt1d
|
||||
PATHS ${SOXT_PREFIX}/lib
|
||||
$ENV{COINDIR}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# try to find SoXt debug lib (regular paths)
|
||||
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG
|
||||
NAMES soxt1d
|
||||
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# SoXt debug library defaults to non-debug lib
|
||||
IF(NOT INVENTOR_SOXT_LIBRARY_DEBUG)
|
||||
IF(INVENTOR_SOXT_LIBRARY)
|
||||
SET(INVENTOR_SOXT_LIBRARY_DEBUG INVENTOR_SOXT_LIBRARY)
|
||||
ENDIF(INVENTOR_SOXT_LIBRARY)
|
||||
ENDIF(NOT INVENTOR_SOXT_LIBRARY_DEBUG)
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
# Locate libvncserver
|
||||
# This module defines
|
||||
# LIBVNCSERVER_LIBRARY
|
||||
# LIBVNCSERVER_FOUND, if false, do not try to link to libvncserver
|
||||
# LIBVNCSERVER_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $LIBVNCSERVER_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$LIBVNCSERVER_DIR
|
||||
# used in building libvncserver.
|
||||
|
||||
FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h
|
||||
$ENV{LIBVNCSERVER_DIR}/include
|
||||
$ENV{LIBVNCSERVER_DIR}
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include # Fink
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBVNCCLIENT_LIBRARY
|
||||
NAMES vncclient
|
||||
PATHS
|
||||
$ENV{LIBVNCSERVER_DIR}/lib
|
||||
$ENV{LIBVNCSERVER_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBVNCSERVER_LIBRARY
|
||||
NAMES vncserver
|
||||
PATHS
|
||||
$ENV{LIBVNCSERVER_DIR}/lib
|
||||
$ENV{LIBVNCSERVER_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
SET(LIBVNCSERVER_FOUND "NO")
|
||||
IF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)
|
||||
SET(LIBVNCSERVER_FOUND "YES")
|
||||
ENDIF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)
|
||||
|
||||
|
||||
@@ -10,42 +10,37 @@
|
||||
# Created by Robert Osfield.
|
||||
|
||||
FIND_PATH(OSG_INCLUDE_DIR osg/Node
|
||||
${OSG_DIR}/include
|
||||
$ENV{OSG_DIR}/include
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include
|
||||
NO_DEFAULT_PATH
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include # Fink
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_PATH(OSG_INCLUDE_DIR osg/Node)
|
||||
|
||||
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
${OSG_DIR}/lib/Debug
|
||||
${OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}/lib/debug
|
||||
$ENV{OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||
NAMES "${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
|
||||
@@ -53,57 +48,16 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
${OSG_DIR}/lib/Release
|
||||
${OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}/lib/Release
|
||||
$ENV{OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
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;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF( NOT ${MYLIBRARY}_DEBUG)
|
||||
IF(MYLIBRARY)
|
||||
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
||||
ENDIF(MYLIBRARY)
|
||||
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
||||
|
||||
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
||||
|
||||
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
|
||||
FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
|
||||
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
|
||||
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
||||
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
||||
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
|
||||
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
||||
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
||||
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
||||
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
|
||||
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
||||
|
||||
SET(OSG_FOUND "NO")
|
||||
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
# Locate OpenEXR
|
||||
# This module defines
|
||||
# OPENEXR_LIBRARY
|
||||
# OPENEXR_FOUND, if false, do not try to link to OpenEXR
|
||||
# OPENEXR_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $OPENEXR_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$OPENEXR_DIR
|
||||
#
|
||||
# Created by Robert Osfield.
|
||||
|
||||
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
||||
$ENV{OPENEXR_DIR}/include
|
||||
$ENV{OPENEXR_DIR}
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include # Fink
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
|
||||
NAMES IlmImf
|
||||
PATHS
|
||||
$ENV{OPENEXR_DIR}/lib
|
||||
$ENV{OPENEXR_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENEXR_Half_LIBRARY
|
||||
NAMES Half
|
||||
PATHS
|
||||
$ENV{OPENEXR_DIR}/lib
|
||||
$ENV{OPENEXR_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
SET(OPENEXR_FOUND "NO")
|
||||
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||
SET(OPENEXR_LIBRARIES
|
||||
${OPENEXR_IlmIlf_LIBRARY}
|
||||
${OPENEXR_Half_LIBRARY}
|
||||
)
|
||||
SET(OPENEXR_FOUND "YES")
|
||||
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||
@@ -1,180 +0,0 @@
|
||||
# - 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/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/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/include/dcmtk/ofstd
|
||||
/usr/include/dcmtk/ofstd
|
||||
/usr/local/dicom/include/dcmtk/ofstd
|
||||
)
|
||||
|
||||
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
|
||||
${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/lib64
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/dicom/lib
|
||||
)
|
||||
|
||||
|
||||
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
|
||||
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
|
||||
${DCMTK_DIR}/dcmdata/include
|
||||
${DCMTK_DIR}/include/dcmdata
|
||||
/usr/local/include/dcmtk/dcmdata
|
||||
/usr/include/dcmtk/dcmdata
|
||||
/usr/local/dicom/include/dcmtk/dcmdata
|
||||
)
|
||||
|
||||
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
|
||||
${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/lib64
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/dicom/lib
|
||||
)
|
||||
|
||||
|
||||
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
|
||||
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
|
||||
${DCMTK_DIR}/dcmimgle/include
|
||||
${DCMTK_DIR}/include/dcmimgle
|
||||
/usr/local/include/dcmtk/dcmimgle
|
||||
/usr/include/dcmtk/dcmimgle
|
||||
/usr/local/dicom/include/dcmtk/dcmimgle
|
||||
)
|
||||
|
||||
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
|
||||
${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/lib64
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/dicom/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
|
||||
${DCMTK_DIR}/imagectn/libsrc/Release
|
||||
${DCMTK_DIR}/imagectn/libsrc/
|
||||
${DCMTK_DIR}/imagectn/libsrc/Debug
|
||||
/usr/local/lib64
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/dicom/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
|
||||
${DCMTK_DIR}/dcmnet/libsrc/Release
|
||||
${DCMTK_DIR}/dcmnet/libsrc/Debug
|
||||
${DCMTK_DIR}/dcmnet/libsrc/
|
||||
/usr/local/lib64
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/dicom/lib
|
||||
)
|
||||
|
||||
|
||||
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 )
|
||||
|
||||
SET( DCMTK_FOUND "YES" )
|
||||
SET( DCMTK_INCLUDE_DIRS
|
||||
${DCMTK_config_INCLUDE_DIR}
|
||||
${DCMTK_ofstd_INCLUDE_DIR}
|
||||
${DCMTK_dcmdata_INCLUDE_DIR}
|
||||
${DCMTK_dcmimgle_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
SET( DCMTK_LIBRARIES
|
||||
${DCMTK_dcmimgle_LIBRARY}
|
||||
${DCMTK_dcmdata_LIBRARY}
|
||||
${DCMTK_ofstd_LIBRARY}
|
||||
${DCMTK_config_LIBRARY}
|
||||
)
|
||||
|
||||
IF(DCMTK_imagedb_LIBRARY)
|
||||
SET( DCMTK_LIBRARIES
|
||||
${DCMTK_LIBRARIES}
|
||||
${DCMTK_imagedb_LIBRARY}
|
||||
)
|
||||
ENDIF(DCMTK_imagedb_LIBRARY)
|
||||
|
||||
IF(DCMTK_dcmnet_LIBRARY)
|
||||
SET( DCMTK_LIBRARIES
|
||||
${DCMTK_LIBRARIES}
|
||||
${DCMTK_dcmnet_LIBRARY}
|
||||
)
|
||||
ENDIF(DCMTK_dcmnet_LIBRARY)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
|
||||
ENDIF( WIN32 )
|
||||
|
||||
ENDIF( 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 )
|
||||
|
||||
IF( NOT DCMTK_FOUND )
|
||||
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
|
||||
MARK_AS_ADVANCED( DCMTK_DIR )
|
||||
ENDIF( NOT DCMTK_FOUND )
|
||||
@@ -15,7 +15,7 @@
|
||||
IF(APPLE)
|
||||
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
|
||||
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
||||
ELSE()
|
||||
ELSE(APPLE)
|
||||
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime.h
|
||||
$ENV{QUICKTIME_DIR}/include
|
||||
$ENV{QUICKTIME_DIR}
|
||||
@@ -39,24 +39,11 @@ ELSE()
|
||||
PATH_SUFFIXES lib64 lib
|
||||
)
|
||||
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
||||
ENDIF()
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
SET(QUICKTIME_FOUND "NO")
|
||||
IF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
|
||||
SET(QUICKTIME_FOUND "YES")
|
||||
ENDIF()
|
||||
ENDIF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
#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
|
||||
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
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)
|
||||
SET(QUICKTIME_FOUND "NO")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
# Locate XUL
|
||||
# This module defines
|
||||
# XUL_LIBRARIES
|
||||
# XUL_FOUND, if false, do not try to link to gdal
|
||||
# XUL_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $XUL_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$XUL_DIR
|
||||
#
|
||||
# Created by Robert Osfield.
|
||||
|
||||
#use pkg-config to find various modues
|
||||
INCLUDE(FindPkgConfig OPTIONAL)
|
||||
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
|
||||
pkg_check_modules(XULRUNNER_JS xulrunner-js)
|
||||
pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
|
||||
pkg_check_modules(XULRUNNER_NSS xulrunner-nss)
|
||||
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
|
||||
FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
|
||||
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
|
||||
$ENV{OSG_DIR}/include/xulrunner
|
||||
$ENV{OSG_DIR}/include
|
||||
$ENV{OSG_DIR}/xulrunner
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/include/xulrunner
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}/xulrunner
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include/xulrunner
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include/xulrunner
|
||||
/usr/local/include
|
||||
/usr/include/xulrunner
|
||||
/usr/include
|
||||
/sw/include/xulrunner # Fink
|
||||
/sw/include # Fink
|
||||
/opt/local/include/xulrunner # DarwinPorts
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include/xulrunner # Blastwave
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include/xulrunner
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include/xulrunner
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
|
||||
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
|
||||
$ENV{OSG_DIR}/include/xulrunner
|
||||
$ENV{OSG_DIR}/include
|
||||
$ENV{OSG_DIR}/xulrunner
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/include/xulrunner
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}/xulrunner
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include/xulrunner
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include/xulrunner
|
||||
/usr/local/include
|
||||
/usr/include/xulrunner
|
||||
/usr/include
|
||||
/sw/include/xulrunner # Fink
|
||||
/sw/include # Fink
|
||||
/opt/local/include/xulrunner # DarwinPorts
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include/xulrunner # Blastwave
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include/xulrunner
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include/xulrunner
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
|
||||
PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
|
||||
$ENV{OSG_DIR}/include/nspr
|
||||
$ENV{OSG_DIR}/include
|
||||
$ENV{OSG_DIR}/nspr
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/include/nspr
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}/nspr
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include/nspr
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include/nspr
|
||||
/usr/local/include
|
||||
/usr/include/nspr
|
||||
/usr/include
|
||||
/sw/include/nspr # Fink
|
||||
/sw/include # Fink
|
||||
/opt/local/include/nspr # DarwinPorts
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include/nspr # Blastwave
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include/nspr
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/nspr
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include/nspr
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
|
||||
PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
|
||||
$ENV{OSG_DIR}/include/mozjs
|
||||
$ENV{OSG_DIR}/include
|
||||
$ENV{OSG_DIR}/mozjs
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/include/mozjs
|
||||
$ENV{OSGDIR}/include
|
||||
$ENV{OSGDIR}/mozjs
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/include/mozjs
|
||||
$ENV{OSG_ROOT}/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include/mozjs
|
||||
/usr/local/include
|
||||
/usr/include/mozjs
|
||||
/usr/include
|
||||
/sw/include/mozjs # Fink
|
||||
/sw/include # Fink
|
||||
/opt/local/include/mozjs # DarwinPorts
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include/mozjs # Blastwave
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include/mozjs
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/mozjs
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include/mozjs
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
FIND_PATH(XUL_DIR
|
||||
NAMES components/appshell.xpt
|
||||
PATHS
|
||||
$ENV{OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib/xulrunner
|
||||
/usr/local/lib
|
||||
/usr/lib/xulrunner
|
||||
/usr/lib
|
||||
/sw/lib/xulrunner
|
||||
/sw/lib
|
||||
/opt/local/lib/xulrunner
|
||||
/opt/local/lib
|
||||
/opt/csw/lib/xulrunner
|
||||
/opt/csw/lib
|
||||
/opt/lib/xulrunner
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64/xulrunner
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
|
||||
PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
|
||||
PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
|
||||
PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
$ENV{OSG_DIR}/lib
|
||||
$ENV{OSG_DIR}
|
||||
$ENV{OSGDIR}/lib
|
||||
$ENV{OSGDIR}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib/xulrunner
|
||||
/usr/local/lib
|
||||
/usr/lib/xulrunner
|
||||
/usr/lib
|
||||
/sw/lib/xulrunner
|
||||
/sw/lib
|
||||
/opt/local/lib/xulrunner
|
||||
/opt/local/lib
|
||||
/opt/csw/lib/xulrunner
|
||||
/opt/csw/lib
|
||||
/opt/lib/xulrunner
|
||||
/opt/lib
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64/xulrunner
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
ENDMACRO(FIND_XUL_LIBRARY LIBRARY LIBRARYNAME)
|
||||
|
||||
|
||||
FIND_XUL_LIBRARY(XUL_LIBRARY xul plds4 plc4 nspr4)
|
||||
FIND_XUL_LIBRARY(XUL_MOZJS_LIBRARY mozjs)
|
||||
FIND_XUL_LIBRARY(XUL_XPCOM_LIBRARY xpcom)
|
||||
FIND_XUL_LIBRARY(XUL_PLUGIN_LIBRARY plds4)
|
||||
FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)
|
||||
|
||||
|
||||
SET(XUL_FOUND "NO")
|
||||
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
|
||||
|
||||
SET(XUL_FOUND "YES")
|
||||
SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
|
||||
SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})
|
||||
|
||||
ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
|
||||
|
||||
# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
|
||||
# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})
|
||||
@@ -1,12 +1,12 @@
|
||||
# Locate zlib
|
||||
# Locate gdal
|
||||
# This module defines
|
||||
# ZLIB_LIBRARY
|
||||
# ZLIB_FOUND, if false, do not try to link to zlib
|
||||
# ZLIB_FOUND, if false, do not try to link to gdal
|
||||
# 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.
|
||||
# used in building gdal.
|
||||
#
|
||||
# Created by Ulrich Hertlein.
|
||||
|
||||
@@ -29,7 +29,7 @@ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ZLIB_LIBRARY
|
||||
NAMES z libz zlib
|
||||
NAMES z libz
|
||||
PATHS
|
||||
$ENV{ZLIB_DIR}/lib
|
||||
$ENV{ZLIB_DIR}
|
||||
|
||||
@@ -22,19 +22,17 @@ SOURCE_GROUP(
|
||||
)
|
||||
|
||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
HANDLE_MSVC_DLL()
|
||||
HANDLE_MSVC_DLL()
|
||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
INSTALL(
|
||||
TARGETS ${LIB_NAME}
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
||||
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
||||
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR}
|
||||
)
|
||||
|
||||
# FIXME: Do not run for OS X framework
|
||||
INSTALL(
|
||||
FILES ${LIB_PUBLIC_HEADERS}
|
||||
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
||||
COMPONENT libopenscenegraph-dev
|
||||
)
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
# This script sets up packaging targets for each "COMPONENT" as specified in INSTALL commands
|
||||
#
|
||||
# for each component a CPackConfig-<component>.cmake is generated in the build tree
|
||||
# and a target is added to call cpack for it (e.g. package_openscenegaph
|
||||
# A target for generating a package with everything that gets INSTALLED is generated (package_openscenegraph-all)
|
||||
# A target for making all of the abaove packages is generated (package_ALL)
|
||||
#
|
||||
# package filenames are created on the form <package>-<platform>-<arch>[-<compiler>]-<build_type>[-static].tar.gz
|
||||
# ...where compiler optionally set using a cmake gui (OSG_CPACK_COMPILER). This script tries to guess compiler version for msvc generators
|
||||
# ...build_type matches CMAKE_BUILD_TYPE for all generators but the msvc ones
|
||||
|
||||
# resolve architecture. The reason i "change" i686 to i386 is that debian packages
|
||||
# require i386 so this is for the future
|
||||
IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||
SET(SYSTEM_ARCH "i386")
|
||||
ELSE()
|
||||
SET(SYSTEM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||
ENDIF()
|
||||
|
||||
# set a default system name - use CMake setting (Linux|Windows|...)
|
||||
SET(SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||
#message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
|
||||
#message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
# for msvc the SYSTEM_NAME is set win32/64 instead of "Windows"
|
||||
IF(MSVC)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(SYSTEM_NAME "win64")
|
||||
ELSE()
|
||||
SET(SYSTEM_NAME "win32")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# Guess the compiler (is this desired for other platforms than windows?)
|
||||
IF(NOT DEFINED OSG_CPACK_COMPILER)
|
||||
INCLUDE(OsgDetermineCompiler)
|
||||
ENDIF()
|
||||
|
||||
# expose the compiler setting to the user
|
||||
SET(OSG_CPACK_COMPILER "${OSG_COMPILER}" CACHE STRING "This ia short string (vc90, vc80sp1, gcc-4.3, ...) describing your compiler. The string is used for creating package filenames")
|
||||
|
||||
IF(OSG_CPACK_COMPILER)
|
||||
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER})
|
||||
ELSE()
|
||||
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
|
||||
ENDIF()
|
||||
|
||||
|
||||
## variables that apply to all packages
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
|
||||
|
||||
# these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.)
|
||||
IF(WIN32)
|
||||
SET(CPACK_GENERATOR "ZIP")
|
||||
ELSE()
|
||||
SET(CPACK_GENERATOR "TGZ")
|
||||
ENDIF()
|
||||
SET(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
|
||||
|
||||
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
|
||||
IF(MSVC_IDE)
|
||||
SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
|
||||
SET(PACKAGE_TARGET_PREFIX "Package ")
|
||||
ELSE()
|
||||
# on un*x an empty CMAKE_BUILD_TYPE means release
|
||||
IF(CMAKE_BUILD_TYPE)
|
||||
SET(OSG_CPACK_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
||||
ELSE()
|
||||
SET(OSG_CPACK_CONFIGURATION "Release")
|
||||
ENDIF()
|
||||
SET(PACKAGE_TARGET_PREFIX "package_")
|
||||
ENDIF()
|
||||
|
||||
# Get all defined components
|
||||
GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
|
||||
IF(NOT CPACK_COMPONENTS_ALL)
|
||||
# cmake 2.6.0 don't supply the COMPONENTS property.
|
||||
# I set it manually to be the packages that can always be packaged
|
||||
MESSAGE("When building packages please consider using cmake version 2.6.1 or above")
|
||||
SET(CPACK_COMPONENTS_ALL libopenscenegraph libopenthreads openscenegraph libopenscenegraph-dev libopenthreads-dev)
|
||||
ENDIF()
|
||||
|
||||
# Create a target that will be used to generate all packages defined below
|
||||
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
|
||||
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
|
||||
|
||||
MACRO(GENERATE_PACKAGING_TARGET package_name)
|
||||
SET(CPACK_PACKAGE_NAME ${package_name})
|
||||
|
||||
# the doc packages don't need a system-arch specification
|
||||
IF(${package} MATCHES -doc)
|
||||
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
|
||||
ELSE()
|
||||
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION}-${OSG_CPACK_SYSTEM_SPEC_STRING}-${OSG_CPACK_CONFIGURATION})
|
||||
IF(NOT DYNAMIC_OPENSCENEGRAPH)
|
||||
SET(OSG_PACKAGE_FILE_NAME ${OSG_PACKAGE_FILE_NAME}-static)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE("${OpenSceneGraph_SOURCE_DIR}/CMakeModules/OsgCPackConfig.cmake.in" "${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake" IMMEDIATE)
|
||||
|
||||
SET(PACKAGE_TARGETNAME "${PACKAGE_TARGET_PREFIX}${package_name}")
|
||||
|
||||
# This is naive and will probably need fixing eventually
|
||||
IF(MSVC)
|
||||
SET(MOVE_COMMAND "move")
|
||||
ELSE()
|
||||
SET(MOVE_COMMAND "mv")
|
||||
ENDIF()
|
||||
|
||||
# Set in and out archive filenames. Windows = zip, others = tar.gz
|
||||
IF(WIN32)
|
||||
SET(ARCHIVE_EXT "zip")
|
||||
ELSE()
|
||||
SET(ARCHIVE_EXT "tar.gz")
|
||||
ENDIF()
|
||||
|
||||
# Create a target that creates the current package
|
||||
# and rename the package to give it proper filename
|
||||
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME}
|
||||
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
|
||||
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||
COMMENT "Run CPack packaging for ${package_name}..."
|
||||
)
|
||||
# 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 parallell building of packages so am going brute here
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
|
||||
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
|
||||
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||
)
|
||||
ENDMACRO(GENERATE_PACKAGING_TARGET)
|
||||
|
||||
# Create configs and targets for a package including all components
|
||||
SET(OSG_CPACK_COMPONENT ALL)
|
||||
GENERATE_PACKAGING_TARGET(openscenegraph-all)
|
||||
|
||||
# Create configs and targets for each component
|
||||
FOREACH(package ${CPACK_COMPONENTS_ALL})
|
||||
SET(OSG_CPACK_COMPONENT ${package})
|
||||
GENERATE_PACKAGING_TARGET(${package})
|
||||
ENDFOREACH()
|
||||
@@ -1,71 +0,0 @@
|
||||
# This file will be configured to contain variables for CPack. These variables
|
||||
# should be set in the CMake list file of the project before CPack module is
|
||||
# included. Example variables are:
|
||||
# CPACK_GENERATOR - Generator used to create package
|
||||
# CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component)
|
||||
# CPACK_CMAKE_GENERATOR - CMake Generator used for the projects
|
||||
# CPACK_INSTALL_COMMANDS - Extra commands to install components
|
||||
# CPACK_INSTALL_DIRECTORIES - Extra directories to install
|
||||
# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package
|
||||
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package
|
||||
# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels
|
||||
# CPACK_PACKAGE_FILE_NAME - Name of the package generated
|
||||
# CPACK_PACKAGE_ICON - Icon used for the package
|
||||
# CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer
|
||||
# CPACK_PACKAGE_NAME - Package project name
|
||||
# CPACK_PACKAGE_VENDOR - Package project vendor
|
||||
# CPACK_PACKAGE_VERSION - Package project version
|
||||
# CPACK_PACKAGE_VERSION_MAJOR - Package project version (major)
|
||||
# CPACK_PACKAGE_VERSION_MINOR - Package project version (minor)
|
||||
# CPACK_PACKAGE_VERSION_PATCH - Package project version (patch)
|
||||
|
||||
# There are certain generator specific ones
|
||||
|
||||
# NSIS Generator:
|
||||
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer
|
||||
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
|
||||
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install
|
||||
|
||||
|
||||
SET(CPACK_BINARY_BUNDLE "${CPACK_BINARY_BUNDLE}")
|
||||
SET(CPACK_BINARY_CYGWIN "${CPACK_BINARY_CYGWIN}")
|
||||
SET(CPACK_BINARY_DEB "${CPACK_BINARY_DEB}")
|
||||
SET(CPACK_BINARY_NSIS "${CPACK_BINARY_NSIS}")
|
||||
SET(CPACK_BINARY_OSXX11 "${CPACK_BINARY_OSXX11}")
|
||||
SET(CPACK_BINARY_PACKAGEMAKER "${CPACK_BINARY_PACKAGEMAKER}")
|
||||
SET(CPACK_BINARY_RPM "${CPACK_BINARY_RPM}")
|
||||
SET(CPACK_BINARY_STGZ "${CPACK_BINARY_STGZ}")
|
||||
SET(CPACK_BINARY_TBZ2 "${CPACK_BINARY_TBZ2}")
|
||||
SET(CPACK_BINARY_TGZ "${CPACK_BINARY_TGZ}")
|
||||
SET(CPACK_BINARY_TZ "${CPACK_BINARY_TZ}")
|
||||
SET(CPACK_BINARY_ZIP "${CPACK_BINARY_ZIP}")
|
||||
SET(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
|
||||
SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL}")
|
||||
SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
|
||||
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
|
||||
SET(CPACK_GENERATOR "${CPACK_GENERATOR}")
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "${OpenSceneGraph_BINARY_DIR};OpenSceneGraph;${OSG_CPACK_COMPONENT};/")
|
||||
SET(CPACK_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}")
|
||||
SET(CPACK_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;")
|
||||
SET(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${OPENSCENEGRAPH_VERSION}")
|
||||
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
|
||||
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
|
||||
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
|
||||
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
|
||||
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_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
|
||||
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
SET(CPACK_PACKAGE_RELOCATABLE "true")
|
||||
SET(CPACK_PACKAGE_VENDOR "The OpenSceneGraph developers and contributors lead by Robert Osfield")
|
||||
SET(CPACK_PACKAGE_VERSION "${OPENSCENEGRAPH_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
|
||||
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
|
||||
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
|
||||
SET(CPACK_SET_DESTDIR "OFF")
|
||||
SET(CPACK_STRIP_FILES "ON")
|
||||
@@ -1,81 +0,0 @@
|
||||
# - Figure out what compiler (and version) cmake is generating for
|
||||
# Once done this will define:
|
||||
#
|
||||
# Variable:
|
||||
# OSG_COMPILER
|
||||
#
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
EXEC_PROGRAM(
|
||||
${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE gcc_compiler_version
|
||||
)
|
||||
#MESSAGE("GCC Version: ${gcc_compiler_version}")
|
||||
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
IF(MSVC)
|
||||
IF(MSVC60)
|
||||
SET(OSG_COMPILER "vc60")
|
||||
ENDIF(MSVC60)
|
||||
IF(MSVC70)
|
||||
SET(OSG_COMPILER "vc70")
|
||||
ENDIF(MSVC70)
|
||||
IF(MSVC71)
|
||||
SET(OSG_COMPILER "vc71")
|
||||
ENDIF(MSVC71)
|
||||
IF(MSVC80)
|
||||
SET(OSG_COMPILER "vc80")
|
||||
ENDIF(MSVC80)
|
||||
IF(MSVC90)
|
||||
SET(OSG_COMPILER "vc90")
|
||||
ENDIF(MSVC90)
|
||||
|
||||
IF(MSVC80)
|
||||
MESSAGE(STATUS "Checking if compiler has service pack 1 installed...")
|
||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "int main() {return 0;}\n")
|
||||
|
||||
TRY_COMPILE(_TRY_RESULT
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||
CMAKE_FLAGS -D CMAKE_VERBOSE_MAKEFILE=ON
|
||||
OUTPUT_VARIABLE OUTPUT
|
||||
)
|
||||
|
||||
IF(_TRY_RESULT)
|
||||
# parse for exact compiler version
|
||||
STRING(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vc_compiler_version "${OUTPUT}")
|
||||
IF(vc_compiler_version)
|
||||
#MESSAGE("${vc_compiler_version}")
|
||||
STRING(REGEX MATCHALL "[0-9]+" CL_VERSION_LIST "${vc_compiler_version}")
|
||||
LIST(GET CL_VERSION_LIST 0 CL_MAJOR_VERSION)
|
||||
LIST(GET CL_VERSION_LIST 1 CL_MINOR_VERSION)
|
||||
LIST(GET CL_VERSION_LIST 2 CL_PATCH_VERSION)
|
||||
LIST(GET CL_VERSION_LIST 3 CL_EXTRA_VERSION)
|
||||
ENDIF(vc_compiler_version)
|
||||
|
||||
# Standard vc80 is 14.00.50727.42, sp1 14.00.50727.762, sp2?
|
||||
# Standard vc90 is 9.0.30729.1, sp1 ?
|
||||
IF(CL_EXTRA_VERSION EQUAL 762)
|
||||
SET(OSG_COMPILER "vc80sp1")
|
||||
ELSE(CL_EXTRA_VERSION EQUAL 762)
|
||||
SET(OSG_COMPILER "vc80")
|
||||
ENDIF(CL_EXTRA_VERSION EQUAL 762)
|
||||
|
||||
# parse for exact visual studio version
|
||||
#IF(MSVC_IDE)
|
||||
# string(REGEX MATCH "Visual Studio Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vs_version "${OUTPUT}")
|
||||
# IF(vs_version)
|
||||
# MESSAGE("${vs_version}")
|
||||
# string(REGEX MATCHALL "[0-9]+" VS_VERSION_LIST "${vs_version}")
|
||||
# list(GET VS_VERSION_LIST 0 VS_MAJOR_VERSION)
|
||||
# list(GET VS_VERSION_LIST 1 VS_MINOR_VERSION)
|
||||
# list(GET VS_VERSION_LIST 2 VS_PATCH_VERSION)
|
||||
# list(GET VS_VERSION_LIST 3 VS_EXTRA_VERSION)
|
||||
# ENDIF(vs_version)
|
||||
#ENDIF(MSVC_IDE)
|
||||
ENDIF(_TRY_RESULT)
|
||||
ENDIF(MSVC80)
|
||||
ENDIF(MSVC)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
@@ -9,36 +9,6 @@
|
||||
# the content of this library for linking when in debugging
|
||||
#######################################################################################################
|
||||
|
||||
# VALID_BUILDER_VERSION: used for replacing CMAKE_VERSION (available in v2.6.3 RC9) and VERSION_GREATER/VERSION_LESS (available in 2.6.2 RC4).
|
||||
# This can be replaced by "IF(${CMAKE_VERSION} VERSION_LESS "x.y.z")" from 2.6.4.
|
||||
SET(VALID_BUILDER_VERSION OFF)
|
||||
MACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
|
||||
SET(VALID_BUILDER_VERSION OFF)
|
||||
IF(CMAKE_MAJOR_VERSION GREATER ${MAJOR_VER})
|
||||
SET(VALID_BUILDER_VERSION ON)
|
||||
ELSEIF(CMAKE_MAJOR_VERSION EQUAL ${MAJOR_VER})
|
||||
IF(CMAKE_MINOR_VERSION GREATER ${MINOR_VER})
|
||||
SET(VALID_BUILDER_VERSION ON)
|
||||
ELSEIF(CMAKE_MINOR_VERSION EQUAL ${MINOR_VER})
|
||||
IF(CMAKE_PATCH_VERSION GREATER ${PATCH_VER})
|
||||
SET(VALID_BUILDER_VERSION ON)
|
||||
ENDIF(CMAKE_PATCH_VERSION GREATER ${PATCH_VER})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
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.
|
||||
BUILDER_VERSION_GREATER(2 6 3)
|
||||
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.6.4
|
||||
|
||||
SET(VALID_BUILDER_VERSION OFF)
|
||||
|
||||
|
||||
MACRO(LINK_WITH_VARIABLES TRGTNAME)
|
||||
FOREACH(varname ${ARGN})
|
||||
@@ -51,22 +21,26 @@ MACRO(LINK_WITH_VARIABLES TRGTNAME)
|
||||
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
|
||||
|
||||
MACRO(LINK_INTERNAL TRGTNAME)
|
||||
IF(NOT CMAKE24)
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN})
|
||||
ELSE(NOT CMAKE24)
|
||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
FOREACH(LINKLIB ${ARGN})
|
||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
#when using versioned names, the .dll name differ from .lib name, there is a problem with that:
|
||||
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
|
||||
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
|
||||
#to library targets used
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
||||
IF(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
|
||||
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
ENDFOREACH(LINKLIB)
|
||||
ENDIF(NOT CMAKE24)
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ENDMACRO(LINK_INTERNAL TRGTNAME)
|
||||
|
||||
MACRO(LINK_EXTERNAL TRGTNAME)
|
||||
@@ -146,44 +120,6 @@ ENDMACRO(SETUP_LINK_LIBRARIES)
|
||||
# this is the common set of command for all the plugins
|
||||
#
|
||||
|
||||
# Sets the output directory property for CMake >= 2.6.0, giving an output path RELATIVE to default one
|
||||
MACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
|
||||
BUILDER_VERSION_GREATER(2 8 0)
|
||||
IF(NOT VALID_BUILDER_VERSION)
|
||||
# If CMake <= 2.8.0 (Testing CMAKE_VERSION is possible in >= 2.6.4)
|
||||
IF(MSVC_IDE)
|
||||
# Using the "prefix" hack
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${RELATIVE_OUTDIR}/")
|
||||
ELSE(MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${RELATIVE_OUTDIR}/")
|
||||
ENDIF(MSVC_IDE)
|
||||
ELSE(NOT VALID_BUILDER_VERSION)
|
||||
# Using the output directory properties
|
||||
|
||||
# Global properties (All generators but VS & Xcode)
|
||||
FILE(TO_CMAKE_PATH TMPVAR "CMAKE_ARCHIVE_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${TMPVAR}")
|
||||
FILE(TO_CMAKE_PATH TMPVAR "CMAKE_RUNTIME_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TMPVAR}")
|
||||
FILE(TO_CMAKE_PATH TMPVAR "CMAKE_LIBRARY_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TMPVAR}")
|
||||
|
||||
# Per-configuration property (VS, Xcode)
|
||||
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES}) # For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
|
||||
STRING(TOUPPER "${CONF}" CONF) # Go uppercase (DEBUG, RELEASE...)
|
||||
|
||||
# We use "FILE(TO_CMAKE_PATH", to create nice looking paths
|
||||
FILE(TO_CMAKE_PATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}}/${RELATIVE_OUTDIR}" TMPVAR)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES "ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${TMPVAR}")
|
||||
FILE(TO_CMAKE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}}/${RELATIVE_OUTDIR}" TMPVAR)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES "RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${TMPVAR}")
|
||||
FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}}/${RELATIVE_OUTDIR}" TMPVAR)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES "LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${TMPVAR}")
|
||||
ENDFOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
|
||||
ENDIF(NOT VALID_BUILDER_VERSION)
|
||||
ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
|
||||
|
||||
|
||||
MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
|
||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||
@@ -198,13 +134,6 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
IF(NOT TARGET_LABEL)
|
||||
SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${TARGET_NAME}")
|
||||
ENDIF(NOT TARGET_LABEL)
|
||||
|
||||
## plugins gets put in libopenscenegraph by default
|
||||
IF(${ARGC} GREATER 1)
|
||||
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
|
||||
ELSE(${ARGC} GREATER 1)
|
||||
SET(PACKAGE_COMPONENT libopenscenegraph)
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
# here we use the command to generate the library
|
||||
|
||||
@@ -220,10 +149,13 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
|
||||
ENDIF(NOT UNIX)
|
||||
ELSE(NOT MSVC)
|
||||
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
|
||||
ELSE(NOT CMAKE24)
|
||||
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
IF(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
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
|
||||
@@ -246,8 +178,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
|
||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
ENDIF(NOT CMAKE24)
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
@@ -257,14 +188,14 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
IF(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS}
|
||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} )
|
||||
ELSE(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_PLUGIN)
|
||||
|
||||
@@ -323,7 +254,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME})
|
||||
|
||||
IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")
|
||||
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
SETUP_LINK_LIBRARIES()
|
||||
@@ -346,7 +277,7 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
|
||||
IF(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
|
||||
ELSE(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin )
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDMACRO(SETUP_APPLICATION)
|
||||
@@ -373,7 +304,7 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
|
||||
IF(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
|
||||
ELSE(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin )
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDMACRO(SETUP_EXAMPLE)
|
||||
@@ -407,42 +338,21 @@ MACRO(HANDLE_MSVC_DLL)
|
||||
ELSE(${ARGC} GREATER 1)
|
||||
SET(LIB_SOVERSION ${OPENSCENEGRAPH_SOVERSION})
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed
|
||||
|
||||
IF(NOT MSVC_IDE)
|
||||
IF (NOT CMAKE24)
|
||||
BUILDER_VERSION_GREATER(2 8 0)
|
||||
IF(NOT VALID_BUILDER_VERSION)
|
||||
# If CMake < 2.8.1
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
ELSE(NOT VALID_BUILDER_VERSION)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "${LIB_PREFIX}${LIB_SOVERSION}-")
|
||||
ENDIF(NOT VALID_BUILDER_VERSION)
|
||||
ELSE (NOT CMAKE24)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${LIB_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
|
||||
)
|
||||
ENDIF (NOT CMAKE24)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-")
|
||||
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${LIB_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
|
||||
)
|
||||
ELSE(NOT MSVC_IDE)
|
||||
IF (NOT CMAKE24)
|
||||
BUILDER_VERSION_GREATER(2 8 0)
|
||||
IF(NOT VALID_BUILDER_VERSION)
|
||||
# If CMake < 2.8.1
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
ELSE(NOT VALID_BUILDER_VERSION)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "${LIB_PREFIX}${LIB_SOVERSION}-")
|
||||
ENDIF(NOT VALID_BUILDER_VERSION)
|
||||
ELSE (NOT CMAKE24)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
ENDIF (NOT CMAKE24)
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
|
||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
## This file should be placed in the root directory of your project.
|
||||
## Then modify the CMakeLists.txt file in the root directory of your
|
||||
## project to incorporate the testing dashboard.
|
||||
## # The following are required to uses Dart and the Cdash dashboard
|
||||
## ENABLE_TESTING()
|
||||
## INCLUDE(Dart)
|
||||
set(CTEST_PROJECT_NAME "OpenSceneGraph")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 CET")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "cdash.openscenegraph.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=OpenSceneGraph")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
@@ -13,9 +13,8 @@
|
||||
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
||||
or later.
|
||||
|
||||
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
|
||||
out in the wxWindows section below. The LGPL is contained in the
|
||||
final section of this license.
|
||||
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid in the wxWindows
|
||||
section below. The LGPL in the final section of this license.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -188,7 +187,7 @@ modification follow. Pay close attention to the difference between a
|
||||
former contains code derived from the library, whereas the latter must
|
||||
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
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
|
||||
208
NEWS.txt
208
NEWS.txt
@@ -1,214 +1,6 @@
|
||||
OSG News
|
||||
========
|
||||
|
||||
= !OpenSceneGraph 2.8.2 release - bug fix release =
|
||||
|
||||
PERTHSHIRE, Scotland - 28th July 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.2, 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 ===
|
||||
The !OpenSceneGraph 2.8.2 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.
|
||||
|
||||
=== Updates between 2.8.2 and 2.8.1 releases include: ===
|
||||
|
||||
* Build fixes for:
|
||||
* !RedHat Enterprise Linux
|
||||
* Building of dicom plugin with ITK under Linux
|
||||
* Crash fixes to:
|
||||
* crash during window destruction under Windows when using closing a MFC based !GraphicsWindow
|
||||
* deadlock under Windows due threading issues with atomic operations in Win32 Barrier implementation
|
||||
* !OpenFlight plugin crashed due to not handling spaces at the end of option strings
|
||||
* !OpenFlight plugin crashed when exported scene graphs contain no TexEnv objects
|
||||
* osganimationtimeline crashed when example model was not found
|
||||
* Bug fixes to :
|
||||
* vertical anchor in osgWidget::Widow was inverted
|
||||
* bsp an mdl plugins to better handling transparency and lighting
|
||||
* computation of sector range in osgSim::!LightPoint
|
||||
* extension checking of FBO packed stencil support
|
||||
* position of tabs at corners of manipulators
|
||||
* threading bug in .osg plugin that occurred during multi-threaded initialization
|
||||
* alignment of Text what setting alignment after assign text string
|
||||
* loading of compressed texture arrays
|
||||
* texture generate mipmap for non power of two textures
|
||||
* regression in X11 key symbol remapping, improved support for Russian keyboards
|
||||
* regression of !StencilMask setting in !RenderStage
|
||||
* small memory leak in X11 usage
|
||||
* Transform::computeBound() double !BoundingSphere support
|
||||
* Resize handling when master and slave Cameras share the same !GraphicsContext
|
||||
* Handling of locale in plugins and env var parsing so it always follows the '.' decimal place convention regardless of the desktop/application locale.
|
||||
|
||||
=== Updates between 2.8.1 and 2.8.0 releases include: ===
|
||||
|
||||
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux
|
||||
* Improved compatibility with SWIG wrapper building
|
||||
* Crash fixes in osg::State, osg::Geometry and osgWidget
|
||||
* Bug fixes to :
|
||||
* draw instanced support
|
||||
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
|
||||
* hdr image loader
|
||||
* handling of opacity maps in 3ds loader
|
||||
* dxf loader
|
||||
* frame buffer object
|
||||
* cursor/event handling in windows
|
||||
* windows threading
|
||||
* memory leak in Collada loader
|
||||
* fixes to display lists/vbo creation that prevent crash under ATI drivers
|
||||
* subface PolygonOffset setting in OpenFlight
|
||||
* osgconv --formats under OSX
|
||||
* osgTerrain::Layer bounding volume calculation
|
||||
|
||||
=== Updates between 2.8 and 2.6 include: ===
|
||||
|
||||
* New osgVolume library for volume rendering, with support for:
|
||||
* High quality GPU based Ray tracing
|
||||
* Transfer functions
|
||||
* Per pixel lighting
|
||||
* Iso surface rendering
|
||||
* Maximum Intensity Projection rendering
|
||||
* Non-power-of-two 3D textures, and 3D texture compression
|
||||
* DICOM loading for reading dicom medical data
|
||||
* New osgAnimation library for character and scene animation.
|
||||
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
|
||||
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
|
||||
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
|
||||
* PDF widget (based on libPoppler)
|
||||
* VNC client widget (based on libVNCServer)
|
||||
* Internet browser client widget (based on Gecko/UBrowser)
|
||||
* New plugins for loading Half-Life 2 maps and models.
|
||||
* New plugin for loading EXR, high dynamic range imagery
|
||||
* Improvements to !DatabasePager, tailored for low latency paging.
|
||||
* Improved runtime stats collection and on screen reporting.
|
||||
* Performance improvements through optimization of matrix operations.
|
||||
* Support for the OpenGL "draw instanced" extension.
|
||||
* Support for zlib compressed native .ive and .gz files
|
||||
* Improvements to COLLADA support.
|
||||
* Build reporting using CDash
|
||||
* New packaging support using CPack
|
||||
* A wide range of build and bug fixes
|
||||
|
||||
=== 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 [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
|
||||
|
||||
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal 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.
|
||||
|
||||
=== !OpenSceneGraph Books now available ===
|
||||
|
||||
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
|
||||
|
||||
=== Professional support and services ===
|
||||
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors 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 2000 developers is centred around the public osg-users mailing list, 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 [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
|
||||
|
||||
----
|
||||
|
||||
About !OpenSceneGraph: [[BR]]
|
||||
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
|
||||
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
|
||||
|
||||
About !OpenSceneGraph Professional Services:[[BR]]
|
||||
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
= !OpenSceneGraph 2.8.1 release - bug fix release =
|
||||
|
||||
PERTHSHIRE, Scotland - 19th May 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.1, 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 ===
|
||||
The !OpenSceneGraph 2.8.1 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.
|
||||
|
||||
=== Updates between 2.8.1 and 2.8.0 releases include: ===
|
||||
|
||||
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux.
|
||||
* Improved compatibility with SWIG wrapper building
|
||||
* Crash fixes in osg::State, osg::Geometry and osgWidget.
|
||||
* Bug fixes to :
|
||||
* draw instanced support
|
||||
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
|
||||
* hdr image loader
|
||||
* handling of opacity maps in 3ds loader
|
||||
* dxf loader
|
||||
* frame buffer object
|
||||
* cursor/event handling in windows
|
||||
* windows threading
|
||||
* memory leak in Collada loader
|
||||
* fixes to display lists/vbo creation that prevent crash under ATI drivers
|
||||
* subface PolygonOffset setting in OpenFlight
|
||||
* osgconv --formats under OSX
|
||||
* osgTerrain::Layer bounding volume calculation.
|
||||
|
||||
=== Updates between 2.8 and 2.6 include: ===
|
||||
|
||||
* New osgVolume library for volume rendering, with support for:
|
||||
* High quality GPU based Ray tracing
|
||||
* Transfer functions
|
||||
* Per pixel lighting
|
||||
* Iso surface rendering
|
||||
* Maximum Intensity Projection rendering
|
||||
* Non-power-of-two 3D textures, and 3D texture compression
|
||||
* DICOM loading for reading dicom medical data
|
||||
* New osgAnimation library for character and scene animation.
|
||||
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
|
||||
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
|
||||
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
|
||||
* PDF widget (based on libPoppler)
|
||||
* VNC client widget (based on libVNCServer)
|
||||
* Internet browser client widget (based on Gecko/UBrowser)
|
||||
* New plugins for loading Half-Life 2 maps and models.
|
||||
* New plugin for loading EXR, high dynamic range imagery
|
||||
* Improvements to !DatabasePager, tailored for low latency paging.
|
||||
* Improved runtime stats collection and on screen reporting.
|
||||
* Performance improvements through optimization of matrix operations.
|
||||
* Support for the OpenGL "draw instanced" extension.
|
||||
* Support for zlib compressed native .ive and .gz files
|
||||
* Improvements to COLLADA support.
|
||||
* Build reporting using CDash
|
||||
* New packaging support using CPack
|
||||
* A wide range of build and bug fixes
|
||||
|
||||
=== 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 [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
|
||||
|
||||
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal 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.
|
||||
|
||||
=== !OpenSceneGraph Books now available ===
|
||||
|
||||
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
|
||||
|
||||
=== Professional support and services ===
|
||||
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors 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 2000 developers is centred around the public osg-users mailing list, 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 [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
|
||||
|
||||
----
|
||||
|
||||
About !OpenSceneGraph: [[BR]]
|
||||
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
|
||||
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
|
||||
|
||||
About !OpenSceneGraph Professional Services:[[BR]]
|
||||
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
= !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 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.
|
||||
|
||||
@@ -5,8 +5,8 @@ REM trees.
|
||||
REM mew 2004-07-16
|
||||
|
||||
cd ..\..
|
||||
set PATH=%CD%\OpenThreads\bin\win32;%CD%\bin;%CD%\3rdParty\bin;%PATH%
|
||||
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%OSG_FILE_PATH%
|
||||
set PATH=%CD%\OpenThreads\bin\win32;%CD%\OpenSceneGraph\bin\win32;%CD%\3rdParty\bin;%PATH%
|
||||
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%CD%\OpenSceneGraph-Data\Images;%CD%\OpenSceneGraph-Data\fonts;%OSG_FILE_PATH%
|
||||
|
||||
REM uncomment one of these for your desired notify level...
|
||||
rem set OSG_NOTIFY_LEVEL=ALWAYS
|
||||
|
||||
@@ -12,9 +12,10 @@ subscribe to our public mailing list:
|
||||
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
||||
|
||||
|
||||
|
||||
Robert Osfield.
|
||||
Project Lead.
|
||||
28th July 2009.
|
||||
5th August 2008.
|
||||
|
||||
--
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,6 @@
|
||||
#ifndef _OPENTHREADS_CONFIG
|
||||
#define _OPENTHREADS_CONFIG
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#define _OPENTHREADS_ATOMIC_USE_MUTEX
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_5)
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
|
||||
#undef _OPENTHREADS_ATOMIC_USE_MUTEX
|
||||
#endif
|
||||
#endif
|
||||
/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */
|
||||
/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
|
||||
/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>osgAnimation</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.OpenSceneGraph.osgAnimation</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.7.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>osgVolume</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.OpenSceneGraph.osgVolume</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.7.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>osganimationviewer</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.OpenSceneGraph.osganimationviewer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>osgmanipulator-example</string>
|
||||
<string>osgmanipulator</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.MySoftwareCompany.osgmanipulator</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
BIN
Xcode/OpenThreads/English.lproj/InfoPlist.strings
Normal file
BIN
Xcode/OpenThreads/English.lproj/InfoPlist.strings
Normal file
Binary file not shown.
@@ -1,24 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>osgWidget</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>OpenThreads</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.OpenSceneGraph.osgWidget</string>
|
||||
<string>org.OpenThreads.OpenThreads</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.2.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
449
Xcode/OpenThreads/OpenThreads.xcodeproj/project.pbxproj
Normal file
449
Xcode/OpenThreads/OpenThreads.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,449 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
00DAF8AA0BBE1A0E00EFEB98 /* Block in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A70BBE1A0E00EFEB98 /* Block */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
00DAF8AB0BBE1A0F00EFEB98 /* ReadWriteMutex in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
00DAF8AC0BBE1A0F00EFEB98 /* ReentrantMutex in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8D07F2BE0486CC7A007CD1D0 /* OpenThreads_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */; };
|
||||
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
||||
8D07F2C40486CC7A007CD1D0 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB77AAFE841565C02AAC07 /* Carbon.framework */; };
|
||||
BE11833405D6FE3900EB53E5 /* PThreadBarrierPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */; };
|
||||
BE11833605D6FE3900EB53E5 /* PThreadConditionPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */; };
|
||||
BE11833805D6FE3900EB53E5 /* PThreadMutexPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */; };
|
||||
BE11833905D6FE3900EB53E5 /* PThreadPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */; };
|
||||
BE11835105D7022C00EB53E5 /* PThread.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832A05D6FE3800EB53E5 /* PThread.c++ */; };
|
||||
BE11835205D7022C00EB53E5 /* PThreadBarrier.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */; };
|
||||
BE11835405D7022C00EB53E5 /* PThreadCondition.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */; };
|
||||
BE11835605D7022C00EB53E5 /* PThreadMutex.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */; };
|
||||
BE11837D05D7083B00EB53E5 /* Barrier in Headers */ = {isa = PBXBuildFile; fileRef = BE11836E05D7082A00EB53E5 /* Barrier */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
BE11837E05D7083B00EB53E5 /* Condition in Headers */ = {isa = PBXBuildFile; fileRef = BE11836F05D7082A00EB53E5 /* Condition */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
BE11837F05D7083B00EB53E5 /* Exports in Headers */ = {isa = PBXBuildFile; fileRef = BE11837005D7082A00EB53E5 /* Exports */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
BE11838005D7083B00EB53E5 /* Mutex in Headers */ = {isa = PBXBuildFile; fileRef = BE11837105D7082A00EB53E5 /* Mutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
BE11838105D7083B00EB53E5 /* ScopedLock in Headers */ = {isa = PBXBuildFile; fileRef = BE11837205D7082A00EB53E5 /* ScopedLock */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
BE11838205D7083B00EB53E5 /* Thread in Headers */ = {isa = PBXBuildFile; fileRef = BE11837305D7082A00EB53E5 /* Thread */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
00DAF8A70BBE1A0E00EFEB98 /* Block */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = Block; path = ../../include/OpenThreads/Block; sourceTree = SOURCE_ROOT; };
|
||||
00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = ReadWriteMutex; path = ../../include/OpenThreads/ReadWriteMutex; sourceTree = SOURCE_ROOT; };
|
||||
00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = ReentrantMutex; path = ../../include/OpenThreads/ReentrantMutex; sourceTree = SOURCE_ROOT; };
|
||||
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
08FB77AAFE841565C02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenThreads_Prefix.pch; sourceTree = SOURCE_ROOT; };
|
||||
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenThreads.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BE11832A05D6FE3800EB53E5 /* PThread.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThread.c++"; path = "../../src/OpenThreads/pthreads/PThread.c++"; sourceTree = SOURCE_ROOT; };
|
||||
BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadBarrier.c++"; path = "../../src/OpenThreads/pthreads/PThreadBarrier.c++"; sourceTree = SOURCE_ROOT; };
|
||||
BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadBarrierPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadBarrierPrivateData.h; sourceTree = SOURCE_ROOT; };
|
||||
BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadCondition.c++"; path = "../../src/OpenThreads/pthreads/PThreadCondition.c++"; sourceTree = SOURCE_ROOT; };
|
||||
BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadConditionPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadConditionPrivateData.h; sourceTree = SOURCE_ROOT; };
|
||||
BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadMutex.c++"; path = "../../src/OpenThreads/pthreads/PThreadMutex.c++"; sourceTree = SOURCE_ROOT; };
|
||||
BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadMutexPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadMutexPrivateData.h; sourceTree = SOURCE_ROOT; };
|
||||
BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadPrivateData.h; sourceTree = SOURCE_ROOT; };
|
||||
BE11836E05D7082A00EB53E5 /* Barrier */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Barrier; path = ../../include/OpenThreads/Barrier; sourceTree = SOURCE_ROOT; };
|
||||
BE11836F05D7082A00EB53E5 /* Condition */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Condition; path = ../../include/OpenThreads/Condition; sourceTree = SOURCE_ROOT; };
|
||||
BE11837005D7082A00EB53E5 /* Exports */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Exports; path = ../../include/OpenThreads/Exports; sourceTree = SOURCE_ROOT; };
|
||||
BE11837105D7082A00EB53E5 /* Mutex */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Mutex; path = ../../include/OpenThreads/Mutex; sourceTree = SOURCE_ROOT; };
|
||||
BE11837205D7082A00EB53E5 /* ScopedLock */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = ScopedLock; path = ../../include/OpenThreads/ScopedLock; sourceTree = SOURCE_ROOT; };
|
||||
BE11837305D7082A00EB53E5 /* Thread */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Thread; path = ../../include/OpenThreads/Thread; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D07F2C40486CC7A007CD1D0 /* Carbon.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
034768DDFF38A45A11DB9C8B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D691FE84028FC02AAC07 /* OpenThreads */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BE11833F05D7005800EB53E5 /* Header */,
|
||||
08FB77ACFE841707C02AAC07 /* Source */,
|
||||
089C1665FE841158C02AAC07 /* Resources */,
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
|
||||
034768DDFF38A45A11DB9C8B /* Products */,
|
||||
);
|
||||
name = OpenThreads;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
08FB77AAFE841565C02AAC07 /* Carbon.framework */,
|
||||
);
|
||||
name = "External Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1665FE841158C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB77ACFE841707C02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BE11832A05D6FE3800EB53E5 /* PThread.c++ */,
|
||||
BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */,
|
||||
BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */,
|
||||
BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */,
|
||||
BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */,
|
||||
BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */,
|
||||
BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */,
|
||||
BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */,
|
||||
32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BE11833F05D7005800EB53E5 /* Header */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BE11835905D7027D00EB53E5 /* OpenThreads */,
|
||||
);
|
||||
name = Header;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BE11835905D7027D00EB53E5 /* OpenThreads */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BE11836E05D7082A00EB53E5 /* Barrier */,
|
||||
00DAF8A70BBE1A0E00EFEB98 /* Block */,
|
||||
BE11836F05D7082A00EB53E5 /* Condition */,
|
||||
BE11837005D7082A00EB53E5 /* Exports */,
|
||||
BE11837105D7082A00EB53E5 /* Mutex */,
|
||||
00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */,
|
||||
00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */,
|
||||
BE11837205D7082A00EB53E5 /* ScopedLock */,
|
||||
BE11837305D7082A00EB53E5 /* Thread */,
|
||||
);
|
||||
name = OpenThreads;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
00DAF8AA0BBE1A0E00EFEB98 /* Block in Headers */,
|
||||
00DAF8AB0BBE1A0F00EFEB98 /* ReadWriteMutex in Headers */,
|
||||
00DAF8AC0BBE1A0F00EFEB98 /* ReentrantMutex in Headers */,
|
||||
BE11837D05D7083B00EB53E5 /* Barrier in Headers */,
|
||||
BE11837E05D7083B00EB53E5 /* Condition in Headers */,
|
||||
BE11837F05D7083B00EB53E5 /* Exports in Headers */,
|
||||
BE11838005D7083B00EB53E5 /* Mutex in Headers */,
|
||||
BE11838105D7083B00EB53E5 /* ScopedLock in Headers */,
|
||||
BE11838205D7083B00EB53E5 /* Thread in Headers */,
|
||||
8D07F2BE0486CC7A007CD1D0 /* OpenThreads_Prefix.pch in Headers */,
|
||||
BE11833405D6FE3900EB53E5 /* PThreadBarrierPrivateData.h in Headers */,
|
||||
BE11833605D6FE3900EB53E5 /* PThreadConditionPrivateData.h in Headers */,
|
||||
BE11833805D6FE3900EB53E5 /* PThreadMutexPrivateData.h in Headers */,
|
||||
BE11833905D6FE3900EB53E5 /* PThreadPrivateData.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D07F2BC0486CC7A007CD1D0 /* OpenThreads */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 0011012F0873634F0015C576 /* Build configuration list for PBXNativeTarget "OpenThreads" */;
|
||||
buildPhases = (
|
||||
8D07F2BD0486CC7A007CD1D0 /* Headers */,
|
||||
8D07F2BF0486CC7A007CD1D0 /* Resources */,
|
||||
8D07F2C10486CC7A007CD1D0 /* Sources */,
|
||||
8D07F2C30486CC7A007CD1D0 /* Frameworks */,
|
||||
8D07F2C50486CC7A007CD1D0 /* Rez */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = OpenThreads;
|
||||
productInstallPath = "$(HOME)/Library/Frameworks";
|
||||
productName = OpenThreads;
|
||||
productReference = 8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 001101330873634F0015C576 /* Build configuration list for PBXProject "OpenThreads" */;
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* OpenThreads */;
|
||||
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
|
||||
projectDirPath = "";
|
||||
targets = (
|
||||
8D07F2BC0486CC7A007CD1D0 /* OpenThreads */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXRezBuildPhase section */
|
||||
8D07F2C50486CC7A007CD1D0 /* Rez */ = {
|
||||
isa = PBXRezBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXRezBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D07F2C10486CC7A007CD1D0 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BE11835105D7022C00EB53E5 /* PThread.c++ in Sources */,
|
||||
BE11835205D7022C00EB53E5 /* PThreadBarrier.c++ in Sources */,
|
||||
BE11835405D7022C00EB53E5 /* PThreadCondition.c++ in Sources */,
|
||||
BE11835605D7022C00EB53E5 /* PThreadMutex.c++ in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C1667FE841158C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
001101300873634F0015C576 /* Development */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUGGING_SYMBOLS = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_ENABLE_TRIGRAPHS = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
LIBRARY_STYLE = Dynamic;
|
||||
MACH_O_TYPE = mh_dylib;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0x1FF00000,
|
||||
);
|
||||
PRODUCT_NAME = OpenThreads;
|
||||
SECTORDER_FLAGS = "";
|
||||
SYMROOT = ../OpenSceneGraph/build;
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
WRAPPER_EXTENSION = framework;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Development;
|
||||
};
|
||||
001101310873634F0015C576 /* Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_ENABLE_TRIGRAPHS = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
LIBRARY_STYLE = Dynamic;
|
||||
MACH_O_TYPE = mh_dylib;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0x1FF00000,
|
||||
);
|
||||
PRODUCT_NAME = OpenThreads;
|
||||
SECTORDER_FLAGS = "";
|
||||
STRIP_INSTALLED_PRODUCT = YES;
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
WRAPPER_EXTENSION = framework;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Deployment;
|
||||
};
|
||||
001101320873634F0015C576 /* Default */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_ENABLE_TRIGRAPHS = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
LIBRARY_STYLE = Dynamic;
|
||||
MACH_O_TYPE = mh_dylib;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0x1FF00000,
|
||||
);
|
||||
PRODUCT_NAME = OpenThreads;
|
||||
SECTORDER_FLAGS = "";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
WRAPPER_EXTENSION = framework;
|
||||
};
|
||||
name = Default;
|
||||
};
|
||||
001101340873634F0015C576 /* Development */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_AUTO_VECTORIZATION = YES;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../include,
|
||||
"$(inherited)",
|
||||
);
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
STRIP_STYLE = "non-global";
|
||||
};
|
||||
name = Development;
|
||||
};
|
||||
001101350873634F0015C576 /* Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
GCC_AUTO_VECTORIZATION = YES;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = s;
|
||||
HEADER_SEARCH_PATHS = ../../include;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
STRIP_STYLE = "non-global";
|
||||
};
|
||||
name = Deployment;
|
||||
};
|
||||
001101360873634F0015C576 /* Default */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_AUTO_VECTORIZATION = YES;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
HEADER_SEARCH_PATHS = ../../include;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
STRIP_STYLE = "non-global";
|
||||
};
|
||||
name = Default;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
0011012F0873634F0015C576 /* Build configuration list for PBXNativeTarget "OpenThreads" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
001101300873634F0015C576 /* Development */,
|
||||
001101310873634F0015C576 /* Deployment */,
|
||||
001101320873634F0015C576 /* Default */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Default;
|
||||
};
|
||||
001101330873634F0015C576 /* Build configuration list for PBXProject "OpenThreads" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
001101340873634F0015C576 /* Development */,
|
||||
001101350873634F0015C576 /* Deployment */,
|
||||
001101360873634F0015C576 /* Default */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Default;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
}
|
||||
5
Xcode/OpenThreads/OpenThreads_Prefix.pch
Normal file
5
Xcode/OpenThreads/OpenThreads_Prefix.pch
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'OpenThreads' target in the 'OpenThreads' project.
|
||||
//
|
||||
|
||||
//#include <Carbon/Carbon.h>
|
||||
16
Xcode/OpenThreads/version.plist
Normal file
16
Xcode/OpenThreads/version.plist
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildVersion</key>
|
||||
<string>38</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>ProjectName</key>
|
||||
<string>CarbonProjectTemplates</string>
|
||||
<key>SourceVersion</key>
|
||||
<string>140000</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -26,20 +26,20 @@ SET(TARGET_COMMON_LIBRARIES
|
||||
osgText
|
||||
)
|
||||
|
||||
IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgviewer)
|
||||
ADD_SUBDIRECTORY(osgarchive)
|
||||
ADD_SUBDIRECTORY(osgconv)
|
||||
ADD_SUBDIRECTORY(osgversion)
|
||||
ADD_SUBDIRECTORY(osgfilecache)
|
||||
|
||||
ADD_SUBDIRECTORY(osgviewer)
|
||||
ADD_SUBDIRECTORY(osgarchive)
|
||||
ADD_SUBDIRECTORY(osgconv)
|
||||
ADD_SUBDIRECTORY(osgfilecache)
|
||||
ADD_SUBDIRECTORY(osgversion)
|
||||
#REWRITE_CMAKELIST(ADD_OSG_EXAMPLE)
|
||||
|
||||
ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
# need to define this on win32 or linker cries about _declspecs
|
||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||
|
||||
ADD_SUBDIRECTORY(osgversion)
|
||||
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
#MESSAGE("---->${MY_EXAMPLE_LIST}<---------")
|
||||
##########to get all the variables of Cmake
|
||||
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)
|
||||
#FOREACH(myvar ${MYVARS})
|
||||
# FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
|
||||
# "${myvar} -->${${myvar}}<-\n"
|
||||
# )
|
||||
#ENDFOREACH(myvar)
|
||||
|
||||
|
||||
@@ -79,12 +79,7 @@ int main( int argc, char **argv )
|
||||
else if (fileType==osgDB::DIRECTORY)
|
||||
{
|
||||
osgDB::DirectoryContents directory = osgDB::getDirectoryContents(arguments[pos]);
|
||||
osgDB::DirectoryContents::iterator it = directory.begin();
|
||||
while( it != directory.end())
|
||||
{
|
||||
files.push_back(filePath + "/" + (*it));
|
||||
++it;
|
||||
}
|
||||
files.insert(files.end(),directory.begin(),directory.end());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -493,17 +493,6 @@ static void usage( const char *prog, const char *msg )
|
||||
" their own color values (--addMissingColours also accepted)."<< std::endl;
|
||||
osg::notify(osg::NOTICE)<<" --overallNormal - Replace normals with a single overall normal."<< std::endl;
|
||||
|
||||
osg::notify( osg::NOTICE ) << std::endl;
|
||||
osg::notify( osg::NOTICE ) <<
|
||||
" --formats - Lists all supported formats and their supported options." << std::endl;
|
||||
osg::notify( osg::NOTICE ) <<
|
||||
" --format <format> - Displays information about the spefied <format>, where <format>\n"
|
||||
" is the file extension, such as \"flt\"." << std::endl;
|
||||
osg::notify( osg::NOTICE ) <<
|
||||
" --plugins - Lists all supported plugin files." << std::endl;
|
||||
osg::notify( osg::NOTICE ) <<
|
||||
" --plugin >plugin> - Displays information about the spefied <plugin>, where <plugin>\n"
|
||||
" is the plugin's full path and file name." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -518,8 +507,8 @@ int main( int argc, char **argv )
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--help-env","Display environmental variables available");
|
||||
//arguments.getApplicationUsage()->addCommandLineOption("--formats","List supported file formats");
|
||||
//arguments.getApplicationUsage()->addCommandLineOption("--plugins","List database olugins");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--formats","List supported file formats");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--plugins","List database olugins");
|
||||
|
||||
|
||||
// if user request help write it out to cout.
|
||||
|
||||
@@ -22,14 +22,11 @@
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/FileCache>
|
||||
#include <osgDB/FileNameUtils>
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static bool s_ExitApplication = false;
|
||||
|
||||
@@ -137,8 +134,6 @@ public:
|
||||
LoadDataVisitor():
|
||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||
_currentLevel(0) {}
|
||||
|
||||
void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; }
|
||||
|
||||
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
|
||||
{
|
||||
@@ -247,8 +242,9 @@ public:
|
||||
filename = plod.getFileName(i);
|
||||
}
|
||||
|
||||
osg::notify(osg::NOTICE)<<"reading "<<filename<<std::endl;
|
||||
|
||||
osg::ref_ptr<osg::Node> node = readNodeFileAndWriteToCache(filename);
|
||||
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(filename);
|
||||
|
||||
if (!s_ExitApplication && node.valid()) node->accept(*this);
|
||||
}
|
||||
@@ -271,37 +267,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
|
||||
{
|
||||
|
||||
if (_fileCache.valid() && osgDB::containsServerAddress(filename))
|
||||
{
|
||||
if (_fileCache->existsInCache(filename))
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"reading from FileCache: "<<filename<<std::endl;
|
||||
return _fileCache->readNode(filename, osgDB::Registry::instance()->getOptions()).takeNode();
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
||||
|
||||
osg::Node* node = osgDB::readNodeFile(filename);
|
||||
if (node)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
|
||||
|
||||
_fileCache->writeNode(*node, filename, osgDB::Registry::instance()->getOptions());
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
||||
return osgDB::readNodeFile(filename);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
|
||||
@@ -367,8 +332,7 @@ protected:
|
||||
typedef std::vector<Extents> ExtentsList;
|
||||
typedef std::vector<osg::Matrix> MatrixStack;
|
||||
typedef std::vector<osg::CoordinateSystemNode*> CSNStack;
|
||||
|
||||
osg::ref_ptr<osgDB::FileCache> _fileCache;
|
||||
|
||||
|
||||
ExtentsList _extentsList;
|
||||
unsigned int _currentLevel;
|
||||
@@ -420,26 +384,6 @@ int main( int argc, char **argv )
|
||||
|
||||
LoadDataVisitor ldv;
|
||||
|
||||
std::string fileCachePath;
|
||||
while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {}
|
||||
|
||||
if (fileCachePath.empty())
|
||||
{
|
||||
const char* env_fileCachePath = getenv("OSG_FILE_CACHE");
|
||||
if (env_fileCachePath)
|
||||
{
|
||||
fileCachePath = env_fileCachePath;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileCachePath.empty())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
ldv.setFileCache(new osgDB::FileCache(fileCachePath));
|
||||
|
||||
unsigned int maxLevels = 0;
|
||||
while(arguments.read("-l",maxLevels))
|
||||
{
|
||||
@@ -452,24 +396,18 @@ int main( int argc, char **argv )
|
||||
ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
|
||||
}
|
||||
|
||||
std::string fileCache;
|
||||
while(arguments.read("--file-cache",fileCache) || arguments.read("-c",fileCache)) {}
|
||||
|
||||
std::string filename;
|
||||
for(int i=1; i<arguments.argc(); ++i)
|
||||
{
|
||||
if (!arguments.isOption(i))
|
||||
{
|
||||
filename = arguments[i];
|
||||
break;
|
||||
}
|
||||
if (!fileCache.empty())
|
||||
{
|
||||
std::string str("OSG_FILE_CACHE=");
|
||||
str += fileCache;
|
||||
|
||||
putenv(strdup((char*)str.c_str()));
|
||||
}
|
||||
|
||||
if (filename.empty())
|
||||
{
|
||||
std::cout<<"No file to load specified."<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename);
|
||||
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||
if (!loadedModel)
|
||||
{
|
||||
std::cout<<"No data loaded, please specify a database to load"<<std::endl;
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
SET(TARGET_SRC osgversion.cpp )
|
||||
|
||||
IF (OSG_MAINTAINER)
|
||||
SET(TARGET_SRC ${TARGET_SRC} Contributors.cpp )
|
||||
ADD_DEFINITIONS("-DBUILD_CONTRIBUTORS")
|
||||
ENDIF(OSG_MAINTAINER)
|
||||
|
||||
SET(TARGET_COMMON_LIBRARIES
|
||||
OpenThreads
|
||||
osg
|
||||
osgDB
|
||||
)
|
||||
|
||||
SETUP_COMMANDLINE_APPLICATION(osgversion)
|
||||
|
||||
@@ -1,838 +0,0 @@
|
||||
// The majority of the application is dedicated to building the
|
||||
// current contribitors list by parsing the ChangeLog, it just takes
|
||||
// one line in the main itself to report the version number.
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include <OpenThreads/Version>
|
||||
|
||||
#include <osg/Notify>
|
||||
#include <osg/Version>
|
||||
#include <osg/ArgumentParser>
|
||||
#include <osg/ApplicationUsage>
|
||||
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Plane>
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/BoundingSphere>
|
||||
|
||||
#include <osgDB/fstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma setlocale("C")
|
||||
#endif
|
||||
|
||||
typedef pair<string, string> NamePair;
|
||||
typedef map<NamePair, unsigned int> NameMap;
|
||||
typedef vector<string> Words;
|
||||
|
||||
NamePair EmptyNamePair;
|
||||
NamePair NameRobertOsfield("Robert", "Osfield");
|
||||
NamePair NameDonBurns ("Don", "Burns");
|
||||
|
||||
|
||||
const char* validNames[] =
|
||||
{
|
||||
"de",
|
||||
"den",
|
||||
"van"
|
||||
};
|
||||
|
||||
const char* invalidNames[] =
|
||||
{
|
||||
"Added",
|
||||
"AnimationPath",
|
||||
"AnimationPathCallback",
|
||||
"AnimationPathManipulator",
|
||||
"ArgumentParser",
|
||||
"AttrData",
|
||||
"AutoTransform",
|
||||
"AutoTransform.",
|
||||
"Azimuth",
|
||||
"BlenColour(Vec4",
|
||||
"Camera",
|
||||
"CameraBarrierCallback",
|
||||
"CameraNode",
|
||||
"Canvas",
|
||||
"CluserCullingCallback",
|
||||
"ClusterCullingCallback",
|
||||
"CoordinateSystem",
|
||||
"CoordinateSystemNode",
|
||||
"CoordinateSystemNode&",
|
||||
"CopyOp",
|
||||
"Copyright",
|
||||
"Core",
|
||||
"Creator",
|
||||
"CullCallbacks",
|
||||
"CullingSettngs",
|
||||
"CullVisitor",
|
||||
"CullVistor",
|
||||
"Cygwin",
|
||||
"DatabasePager",
|
||||
"DataSet",
|
||||
"DataVariance",
|
||||
"DeleteHandler",
|
||||
"DisplaySettings",
|
||||
"Drawable",
|
||||
"DrawElementsUByte",
|
||||
"Endian",
|
||||
"Escape",
|
||||
"EventQueue",
|
||||
"Face",
|
||||
"Files",
|
||||
"Fixed",
|
||||
"Fixes",
|
||||
"FluidProgram",
|
||||
"FontImplementation",
|
||||
"FrameStats",
|
||||
"Framstamp",
|
||||
"FreeBSD",
|
||||
"Geode",
|
||||
"GeoemtryTechnique",
|
||||
"GeometryTechnique",
|
||||
"GeoSet",
|
||||
"GraphicsContext",
|
||||
"GraphicsContextImplementation",
|
||||
"GraphicsThread",
|
||||
"GraphicsWindowX11",
|
||||
"Group",
|
||||
"Image",
|
||||
"ImageOptions",
|
||||
"Images",
|
||||
"Images/SolarSystem",
|
||||
"ImageStream",
|
||||
"Improved",
|
||||
"IndexBlock",
|
||||
"IndexFaceSets",
|
||||
"IntersectVisitor",
|
||||
"Inventor",
|
||||
"KdTree",
|
||||
"KeyboardMouse",
|
||||
"KeyboardMouseCallback",
|
||||
"LightModel",
|
||||
"LightPointNode",
|
||||
"LineSegment",
|
||||
"LineStipple",
|
||||
"Logos",
|
||||
"LongIDRecord",
|
||||
"Make",
|
||||
"Makefile",
|
||||
"Material",
|
||||
"Matrix",
|
||||
"Matrix*",
|
||||
"MatrixManipulator",
|
||||
"MatrixTransform",
|
||||
"MemoryManager",
|
||||
"MergeGeometryVisitor",
|
||||
"MeshRecord",
|
||||
"Mode",
|
||||
"Mr",
|
||||
"Multigen",
|
||||
"New",
|
||||
"NewCullVisitor",
|
||||
"NodeVisitor",
|
||||
"Object",
|
||||
"OpenDX",
|
||||
"OpenSceneGraph",
|
||||
"OpenSceneGraph-2",
|
||||
"OpenSceneGraph-osgWidget-dev",
|
||||
"OpenThreads",
|
||||
"OperationThread",
|
||||
"Optimizer",
|
||||
"OrientationConverter",
|
||||
"Osfields",
|
||||
"Ouput",
|
||||
"Output",
|
||||
"OveralyNode",
|
||||
"PagedLOD",
|
||||
"PageLOD",
|
||||
"Paging",
|
||||
"ParentList",
|
||||
"Performer",
|
||||
"PickHandler",
|
||||
"PixelDataBufferObject",
|
||||
"PolygonStipple",
|
||||
"PolytopeVisitor",
|
||||
"PrimitiveIndexFunctor",
|
||||
"Prodcuer",
|
||||
"Producer",
|
||||
"ProducerEventCallback",
|
||||
"Program",
|
||||
"Proxy",
|
||||
"ProxyNode",
|
||||
"Quake3",
|
||||
"Quicktime",
|
||||
"ReaderWriters",
|
||||
"ReentrantMutex",
|
||||
"Referenced",
|
||||
"ReferenceFrame",
|
||||
"Removed",
|
||||
"RemoveLoadedProxyNodes",
|
||||
"RenderStage",
|
||||
"RenderTargetFallback",
|
||||
"RenderToTextureStage",
|
||||
"SceneGraphBuilder",
|
||||
"SceneView",
|
||||
"Sequence",
|
||||
"Shape",
|
||||
"SimpleViewer",
|
||||
"SimpleViewer",
|
||||
"SmokeTrailEffect",
|
||||
"Source",
|
||||
"SpotExponent",
|
||||
"State",
|
||||
"StateAttribute",
|
||||
"Stats",
|
||||
"StatsVisitor",
|
||||
"Studio",
|
||||
"Support",
|
||||
"Switch",
|
||||
"TechniqueEventHandler",
|
||||
"TerraPage",
|
||||
"TessellationHints",
|
||||
"TestManipulator",
|
||||
"TestSupportCallback",
|
||||
"TexEnv",
|
||||
"TexMat(Matrix",
|
||||
"Texture",
|
||||
"Texture2DArray",
|
||||
"Texture3D",
|
||||
"TextureCubeMap",
|
||||
"TextureObjectManager",
|
||||
"TextureRectangle",
|
||||
"TextureRectangle(Image*",
|
||||
"TextureType",
|
||||
"Texuture",
|
||||
"TriStripVisitor",
|
||||
"TrPageViewer",
|
||||
"Uniform",
|
||||
"UseFarLineSegments",
|
||||
"UserData",
|
||||
"Valve",
|
||||
"Vec*",
|
||||
"Vec2d",
|
||||
"Vec3d",
|
||||
"Vec4ub",
|
||||
"Version",
|
||||
"VertexData",
|
||||
"View",
|
||||
"Viewer",
|
||||
"ViewPoint",
|
||||
"Viewport",
|
||||
"Viewport",
|
||||
"Visual",
|
||||
"VisualStudio",
|
||||
"WindowData",
|
||||
"Windows",
|
||||
"X",
|
||||
"Xcode",
|
||||
"Y"
|
||||
};
|
||||
|
||||
|
||||
struct TypoCorrection
|
||||
{
|
||||
const char* original;
|
||||
const char* corrected;
|
||||
};
|
||||
|
||||
TypoCorrection typoCorrections[] =
|
||||
{
|
||||
{"Aderian", "Adrian"},
|
||||
{"Adndre", "Andre"},
|
||||
{"Adrain", "Adrian"},
|
||||
{"Amueller", "Aumueller"},
|
||||
{"Andew", "Andrew"},
|
||||
{"André", "Andr<EFBFBD>"},
|
||||
{"Antione", "Antoine"},
|
||||
{"Antonoine", "Antoine"},
|
||||
{"Atr", "Art"},
|
||||
{"Baverage", "Beverage"},
|
||||
{"Bistroviae", "Bistrovic"},
|
||||
{"Callue", "Callu"},
|
||||
{"Christaiansen", "Christiansen"},
|
||||
{"Cobin", "Corbin"},
|
||||
{"Comporesi", "Camporesi"},
|
||||
{"Connel", "Connell"},
|
||||
{"Cullu", "Callu"},
|
||||
{"Daneil", "Daniel"},
|
||||
{"Daust", "Daoust"},
|
||||
{"Daved", "David"},
|
||||
{"Drederic", "Frederic"},
|
||||
{"Eileman", "Eilemann"},
|
||||
{"Elgi", "Egli"},
|
||||
{"Fabian", "Fabien"},
|
||||
{"Fautre", "Fautr<EFBFBD>"},
|
||||
{"Frashid", "Farshid"},
|
||||
{"Fred", "Frederic"},
|
||||
{"Fredrick", "Frederic"},
|
||||
{"Fredric", "Frederic"},
|
||||
{"Froechlich", "Fr<EFBFBD>hlich"},
|
||||
{"Froehilch", "Fr<EFBFBD>hlich"},
|
||||
{"Froehlich", "Fr<EFBFBD>hlich"},
|
||||
{"Froelich", "Fr<EFBFBD>hlich"},
|
||||
{"Froenlich", "Fr<EFBFBD>hlich"},
|
||||
{"Fröhlich", "Fr<EFBFBD>hlich"},
|
||||
{"Fruciel", "Frauciel"},
|
||||
{"García", "Garcea"},
|
||||
{"Garrat", "Garrett"},
|
||||
{"Garret", "Garrett"},
|
||||
{"Geof", "Geoff"},
|
||||
{"Giatan", "Gaitan"},
|
||||
{"Gronenger", "Gronager"},
|
||||
{"Gronger", "Gronager"},
|
||||
{"Haritchablaet", "Haritchabalet"},
|
||||
{"Hebelin", "Herbelin"},
|
||||
{"Heirtlein", "Hertlein"},
|
||||
{"Heirtlein", "Hertlein"},
|
||||
{"Hertleinm", "Hertlein"},
|
||||
{"Hertlien", "Hertlein"},
|
||||
{"Hi", "He"},
|
||||
{"Hooper", "Hopper"},
|
||||
{"Inverson", "Iverson"},
|
||||
{"Iversion", "Iverson"},
|
||||
{"Jean-Sebastein", "Jean-Sebastien"},
|
||||
{"Jean-Sebastian", "Jean-Sebastien"},
|
||||
{"Jean-Sebastirn", "Jean-Sebastien"},
|
||||
{"Jea-Sebastien", "Jean-Sebastien"},
|
||||
{"Johhansen", "Johansen"},
|
||||
{"Johnansen", "Johansen"},
|
||||
{"Johnasen", "Johansen"},
|
||||
{"Jolly", "Jolley"},
|
||||
{"Jose", "Jos<EFBFBD>"},
|
||||
{"José", "Jos<EFBFBD>"},
|
||||
{"Joson", "Jason"},
|
||||
{"J", "Jos<EFBFBD>"},
|
||||
{"Keuhne", "Kuehne"},
|
||||
{"Kheune", "Kuehne"},
|
||||
{"Lagrade", "Lagarde"},
|
||||
{"Largade", "Lagarde"},
|
||||
{"Larshkari", "Lashkari"},
|
||||
{"Lashakari", "Lashkari"},
|
||||
{"Lashari", "Lashkari"},
|
||||
{"Lasharki", "Lashkari"},
|
||||
{"Laskari", "Lashkari"},
|
||||
{"Leandowski", "Lewandowski"},
|
||||
{"Lawandowski", "Lewandowski"},
|
||||
{"Lucas", "Luaces"},
|
||||
{"Lugi", "Luigi"},
|
||||
{"Lweandowski", "Lewandowski"},
|
||||
{"Maceij", "Maciej"},
|
||||
{"Machler", "M<EFBFBD>chler"},
|
||||
{"Macro", "Marco"},
|
||||
{"Maechler", "M<EFBFBD>chler"},
|
||||
{"Mahai", "Mihai"},
|
||||
{"Mammond", "Marmond"},
|
||||
{"March", "Marco"},
|
||||
{"Martsz", "Martz"},
|
||||
{"Marz", "Martz"},
|
||||
{"Matz", "Martz"},
|
||||
{"Melchoir", "Melchior"},
|
||||
{"Mellis", "Melis"},
|
||||
{"Messerschimdt", "Messerschmidt"},
|
||||
{"Micheal", "Michael"},
|
||||
{"Mihair", "Mihai"},
|
||||
{"Molishtan", "Moloshtan"},
|
||||
{"Molishtan", "Moloshtan"},
|
||||
{"Moloshton", "Moloshtan"},
|
||||
{"Morné", "Morn<EFBFBD>"},
|
||||
{"Morne", "Morn<EFBFBD>"},
|
||||
{"Moule", "Moiule"},
|
||||
{"Narache", "Marache"},
|
||||
{"Nicklov", "Nikolov"},
|
||||
{"Nickolov", "Nikolov"},
|
||||
{"Olad", "Olaf"},
|
||||
{"Olar", "Olaf"},
|
||||
{"Oritz", "Ortiz"},
|
||||
{"Osfeld", "Osfield"},
|
||||
{"Osfied", "Osfield"},
|
||||
{"Pail", "Paul"},
|
||||
{"Rajce", "Trajce"},
|
||||
{"Randal", "Randall"},
|
||||
{"Robet", "Robert"},
|
||||
{"Rodger", "Roger"},
|
||||
{"Rolad", "Roland"},
|
||||
{"Rucard", "Richard"},
|
||||
{"Sekender", "Sukender"},
|
||||
{"Sewel", "Sewell"},
|
||||
{"Simmonson", "Simonsson"},
|
||||
{"Simmonsson", "Simonsson"},
|
||||
{"Sjolie", "Sj<EFBFBD>lie"},
|
||||
{"Sjölie", "Sj<EFBFBD>lie"},
|
||||
{"Skinnder", "Skinner"},
|
||||
{"Sokolosky", "Sokolowsky"},
|
||||
{"Sokolowky", "Sokolowsky"},
|
||||
{"Sokolowki", "Sokolowsky"},
|
||||
{"Sokolowski", "Sokolowsky"},
|
||||
{"Sokolsky", "Sokolowsky"},
|
||||
{"Sokolwsky", "Sokolowsky"},
|
||||
{"Sonda", "Sondra"},
|
||||
{"Stansilav", "Stanislav"},
|
||||
{"Stefan", "Stephan"},
|
||||
{"Stell", "Steel"},
|
||||
{"Sylvan", "Sylvain"},
|
||||
{"Takeahei", "Takahei"},
|
||||
{"Takehei", "Takahei"},
|
||||
{"Tery", "Terry"},
|
||||
{"Tarantilils", "Tarantilis"},
|
||||
{"Trastenjak", "Trstenjak"},
|
||||
{"Urlich", "Ulrich"},
|
||||
{"Vines", "Vine"},
|
||||
{"Waldrom", "Waldron"},
|
||||
{"Wedner", "Weidner"},
|
||||
{"Weidemann", "Wiedemann"},
|
||||
{"Wieblen", "Weiblen"},
|
||||
{"Woesnner", "Woessner"},
|
||||
{"Wojchiech", "Wojciech"},
|
||||
{"Wojiech", "Wojciech"},
|
||||
{"Xennon", "Hanson"},
|
||||
{"Yefrei", "Yefei"},
|
||||
{"Yfei", "Yefei"}
|
||||
};
|
||||
|
||||
|
||||
struct NameCorrection
|
||||
{
|
||||
const char* originalFirst;
|
||||
const char* originalSecond;
|
||||
const char* correctedFirst;
|
||||
const char* correctedSecond;
|
||||
};
|
||||
|
||||
NameCorrection nameCorrections[] =
|
||||
{
|
||||
{"Marc", "Sciabica",
|
||||
"Mark", "Sciabica"},
|
||||
{"Jean", "Sebastien",
|
||||
"Jean-Sebastien", "Guay"},
|
||||
{"Michale", "Platings",
|
||||
"Michael", "Platings"},
|
||||
{"Mick", "",
|
||||
"Maik", "Keller"},
|
||||
{"Gary", "Quin",
|
||||
"Gary", "Quinn"},
|
||||
{"BjornHein", "",
|
||||
"Bj<EFBFBD>rn", "Hein"},
|
||||
{"Bjorn", "Hein",
|
||||
"Bj<EFBFBD>rn", "Hein"},
|
||||
{"Erik", "van",
|
||||
"Erik", "den Dekker"},
|
||||
{"Erik", "den",
|
||||
"Erik", "den Dekker"},
|
||||
{"Jeoen", "den",
|
||||
"Jeroen", "den Dekker"},
|
||||
{"John", "Vidar",
|
||||
"John", "Vidar Larring"},
|
||||
{"John", "Vida",
|
||||
"John", "Vidar Larring"},
|
||||
{"Sebastien", "Messerschmidt",
|
||||
"Sebastian", "Messerschmidt"},
|
||||
{"Mattias", "Fr<EFBFBD>hlich",
|
||||
"Mathias", "Fr<EFBFBD>hlich"},
|
||||
{"Mathias", "Helsing",
|
||||
"Mattias", "Helsing"},
|
||||
{"Jose", "Delport",
|
||||
"J.P.", "Delport"},
|
||||
{"Jos<EFBFBD>", "Delport",
|
||||
"J.P.", "Delport"},
|
||||
{"Franz", "Melchior",
|
||||
"Melchior", "Franz"},
|
||||
{"Glen", "Waldon",
|
||||
"Glenn", "Waldron"},
|
||||
{"Ralf", "Karn",
|
||||
"Ralf", "Kern"},
|
||||
{"Donny", "Cipperly",
|
||||
"Donald", "Cipperly"},
|
||||
{"Gino", "van",
|
||||
"Gino", "van den Bergen"},
|
||||
{"Radu", "Mihai",
|
||||
"Mihai", "Radu"},
|
||||
{"Art", "Trevs",
|
||||
"Art", "Tevs"},
|
||||
{"Tim", "More",
|
||||
"Tim", "Moore"},
|
||||
{"Andre", "Garneau",
|
||||
"Andr<EFBFBD>", "Garneau"},
|
||||
{"Eric", "Hammil",
|
||||
"Chris", "Hanson"},
|
||||
{"Paul", "de",
|
||||
"Paul", "de Repentigny"},
|
||||
{"Raymond", "de",
|
||||
"Raymond", "de Vries"},
|
||||
{"Nick", "",
|
||||
"Trajce", "Nikolov"},
|
||||
{"Daniel", "",
|
||||
"Daniel", "Sj<EFBFBD>lie"},
|
||||
{"Julia", "Ortiz",
|
||||
"Julian", "Ortiz"},
|
||||
{"Rune", "Schmidt",
|
||||
"Rune", "Schmidt Jensen"},
|
||||
{"Romano", "Jos<EFBFBD>",
|
||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||
{"Rommano", "Silva",
|
||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||
{"Leandro", "Motta",
|
||||
"Leandro", "Motta Barros"},
|
||||
{"A", "Botorabi",
|
||||
"Ali", "Botorabi"},
|
||||
{"Waltice", "",
|
||||
"Walter", "J. Altice"},
|
||||
{"Drew", "",
|
||||
"Drew", "Whitehouse"},
|
||||
{"Douglas", "A",
|
||||
"Douglas", "A. Pouk"},
|
||||
{"Colin", "MacDonald",
|
||||
"Colin", "McDonald"},
|
||||
{"Nikolov", "Trajce",
|
||||
"Trajce", "Nikolov"},
|
||||
{"Frauciel", "Luc",
|
||||
"Luc", "Frauciel"},
|
||||
};
|
||||
|
||||
|
||||
bool validName(const string& first)
|
||||
{
|
||||
// Check for valid names
|
||||
for (unsigned int i = 0; i < sizeof(validNames) / sizeof(char*); ++i)
|
||||
{
|
||||
if (first == validNames[i])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (first.empty()) return false;
|
||||
|
||||
if (first[0] < 'A' || first[0] > 'Z') return false;
|
||||
|
||||
if (first.size() >= 2 && (first[1] < 'a' || first[1] > 'z') && (first[1] != '.') && (first[1] != ',')) return false;
|
||||
|
||||
// Check for invalid names
|
||||
for (unsigned int i = 0; i < sizeof(invalidNames) / sizeof(char*); ++i)
|
||||
{
|
||||
if (first == invalidNames[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to a valid name
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
string typoCorrection(const string& name)
|
||||
{
|
||||
// Loop over all known typo corrections
|
||||
for (unsigned int i = 0; i < sizeof(typoCorrections) / sizeof(TypoCorrection); ++i)
|
||||
{
|
||||
// If a typo is found
|
||||
if (name == typoCorrections[i].original)
|
||||
{
|
||||
// Return the correction
|
||||
return typoCorrections[i].corrected;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
void nameCorrection(NamePair& name)
|
||||
{
|
||||
// Loop over all known name corrections
|
||||
for (unsigned int i = 0; i < sizeof(nameCorrections) / sizeof(NameCorrection); ++i)
|
||||
{
|
||||
// If a matching name is found
|
||||
if (name.first == nameCorrections[i].originalFirst &&
|
||||
name.second == nameCorrections[i].originalSecond)
|
||||
{
|
||||
// Return the correction
|
||||
name.first = nameCorrections[i].correctedFirst;
|
||||
name.second = nameCorrections[i].correctedSecond;
|
||||
|
||||
// Early out, since we don't want corrections of corrections
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lastValidCharacter(const string& name, unsigned int& pos, char c)
|
||||
{
|
||||
for (unsigned int i = 0; i < pos; ++i)
|
||||
{
|
||||
if (name[i] == c)
|
||||
{
|
||||
pos = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lastValidCharacter(const string& name, unsigned int& last)
|
||||
{
|
||||
lastValidCharacter(name, last, '.');
|
||||
lastValidCharacter(name, last, ',');
|
||||
lastValidCharacter(name, last, '\'');
|
||||
lastValidCharacter(name, last, '/');
|
||||
lastValidCharacter(name, last, '\\');
|
||||
lastValidCharacter(name, last, ':');
|
||||
lastValidCharacter(name, last, ';');
|
||||
lastValidCharacter(name, last, ')');
|
||||
}
|
||||
|
||||
|
||||
NamePair createName(const string& first, const string& second)
|
||||
{
|
||||
if (first.empty()) return EmptyNamePair;
|
||||
|
||||
// cout << "first = " << first << " second = " << second << endl;
|
||||
|
||||
unsigned int last = first.size();
|
||||
lastValidCharacter(first, last);
|
||||
|
||||
if (last == 0) return EmptyNamePair;
|
||||
|
||||
string name;
|
||||
|
||||
name.append(first.begin(), first.begin() + last);
|
||||
|
||||
if (!validName(name)) return EmptyNamePair;
|
||||
|
||||
name = typoCorrection(name);
|
||||
|
||||
if (second.empty() ||
|
||||
!validName(second))
|
||||
{
|
||||
// filter any single or two letter words as unlike to be names.
|
||||
if (name.size() <= 2) return EmptyNamePair;
|
||||
|
||||
return NamePair(name, "");
|
||||
}
|
||||
|
||||
last = second.size();
|
||||
|
||||
lastValidCharacter(second, last);
|
||||
|
||||
if (last > 0)
|
||||
{
|
||||
string surname(second.begin(), second.begin() + last);
|
||||
|
||||
if (validName(surname))
|
||||
{
|
||||
surname = typoCorrection(surname);
|
||||
return NamePair(name, surname);
|
||||
}
|
||||
}
|
||||
|
||||
// filter any single or two letter words as unlike to be names.
|
||||
if (name.size() <= 2) return EmptyNamePair;
|
||||
|
||||
return NamePair(name, "");
|
||||
}
|
||||
|
||||
|
||||
bool submissionsSequence(const Words& words, unsigned int& i)
|
||||
{
|
||||
if (i + 1 >= words.size()) return false;
|
||||
|
||||
if (words[i] == "From" ||
|
||||
words[i] == "from" ||
|
||||
words[i] == "From:" ||
|
||||
words[i] == "from:" ||
|
||||
words[i] == "Merged" ||
|
||||
words[i] == "Integrated") return true;
|
||||
|
||||
if (i + 2 >= words.size()) return false;
|
||||
|
||||
if (words[i] == "submitted" && words[i + 1] == "by")
|
||||
{
|
||||
i += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i] == "Folded" && words[i + 1] == "in")
|
||||
{
|
||||
i += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i] == "Rolled" && words[i + 1] == "in")
|
||||
{
|
||||
i += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i] == "Checked" && words[i + 1] == "in")
|
||||
{
|
||||
i += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i + 3 >= words.size()) return false;
|
||||
|
||||
if (words[i] == "sent" && words[i + 1] == "in" && words[i + 2] == "by")
|
||||
{
|
||||
i += 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void readContributors(NameMap& names, const string& file)
|
||||
{
|
||||
osgDB::ifstream fin(file.c_str());
|
||||
|
||||
Words words;
|
||||
while(fin)
|
||||
{
|
||||
string keyword;
|
||||
fin >> keyword;
|
||||
words.push_back(keyword);
|
||||
}
|
||||
|
||||
string blank_string;
|
||||
|
||||
for(unsigned int i = 0; i < words.size(); ++i)
|
||||
{
|
||||
if (submissionsSequence(words, i))
|
||||
{
|
||||
if (i + 2 < words.size() && validName(words[i + 1]))
|
||||
{
|
||||
NamePair name = createName(words[i + 1], words[i + 2]);
|
||||
nameCorrection(name);
|
||||
if (!name.first.empty()) ++names[name];
|
||||
i += 2;
|
||||
}
|
||||
else if (i + 1 < words.size() && validName(words[i + 1]))
|
||||
{
|
||||
NamePair name = createName(words[i + 1], blank_string);
|
||||
nameCorrection(name);
|
||||
if (!name.first.empty()) ++names[name];
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (words[i] == "robert")
|
||||
{
|
||||
++names[NameRobertOsfield];
|
||||
}
|
||||
else if (words[i] == "don")
|
||||
{
|
||||
++names[NameDonBurns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reassign fisrt name entries to their full names entries
|
||||
if (names.size() > 1)
|
||||
{
|
||||
for (NameMap::iterator itr = names.begin(); itr != names.end(); )
|
||||
{
|
||||
if (itr->first.second.empty())
|
||||
{
|
||||
NameMap::iterator next_itr = itr;
|
||||
++next_itr;
|
||||
|
||||
if (next_itr != names.end() && itr->first.first == next_itr->first.first)
|
||||
{
|
||||
next_itr->second += itr->second;
|
||||
names.erase(itr);
|
||||
itr = next_itr;
|
||||
}
|
||||
else
|
||||
{
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove the double entries from Robert's contributions
|
||||
if (names.size() > 1)
|
||||
{
|
||||
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
|
||||
{
|
||||
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns)
|
||||
{
|
||||
names[NameRobertOsfield] -= itr->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void buildContributors(NameMap& names)
|
||||
{
|
||||
// top five contributors
|
||||
++names[NamePair("Robert", "Osfield")];
|
||||
++names[NamePair("Don", "Burns")];
|
||||
++names[NamePair("Marco", "Jez")];
|
||||
++names[NamePair("Mike", "Weiblen")];
|
||||
++names[NamePair("Geoff", "Michel")];
|
||||
++names[NamePair("Ben", "van Basten")];
|
||||
|
||||
// contributors that don't appear in the ChangeLog due to their contributions
|
||||
// being before CVS started for the OSG, or before the name logging began.
|
||||
++names[NamePair("Karsten", "Weiss")];
|
||||
++names[NamePair("Graeme", "Harkness")];
|
||||
++names[NamePair("Axel", "Volley")];
|
||||
++names[NamePair("Nikolaus", "Hanekamp")];
|
||||
++names[NamePair("Kristopher", "Bixler")];
|
||||
++names[NamePair("Tanguy", "Fautr<EFBFBD>")];
|
||||
++names[NamePair("J.E.", "Hoffmann")];
|
||||
}
|
||||
|
||||
|
||||
void printContributors(const std::string& changeLog, bool printNumEntries)
|
||||
{
|
||||
NameMap names;
|
||||
buildContributors(names);
|
||||
if (!changeLog.empty())
|
||||
{
|
||||
readContributors(names, changeLog);
|
||||
}
|
||||
|
||||
typedef multimap<unsigned int, NamePair> SortedNameMap;
|
||||
|
||||
SortedNameMap sortedNames;
|
||||
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
|
||||
{
|
||||
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
|
||||
}
|
||||
|
||||
cout << names.size() << " Contributors:" << endl << endl;
|
||||
|
||||
if (printNumEntries)
|
||||
{
|
||||
cout << "Entries Firstname Surname" << endl;
|
||||
cout << "-------------------------" << endl;
|
||||
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||
{
|
||||
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Firstname Surname" << endl;
|
||||
cout << "-----------------" << endl;
|
||||
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||
{
|
||||
cout << sitr->second.first << " " << sitr->second.second << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,3 @@
|
||||
// The majority of the application is dedicated to building the
|
||||
// current contribitors list by parsing the ChangeLog, it just takes
|
||||
// one line in the main itself to report the version number.
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include <OpenThreads/Version>
|
||||
|
||||
#include <osg/Notify>
|
||||
#include <osg/Version>
|
||||
#include <osg/ArgumentParser>
|
||||
#include <osg/ApplicationUsage>
|
||||
@@ -18,137 +7,916 @@
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/BoundingSphere>
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
extern void printContributors(const std::string& changeLog, bool printNumEntries);
|
||||
|
||||
#include <OpenThreads/Version>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
// the majority of the application is dedicated to building the
|
||||
// current contribitors list by parsing the ChangeLog, it just takes
|
||||
// one line in the main itself to report the version number.
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma setlocale("C")
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
typedef std::pair<std::string, std::string> NamePair;
|
||||
typedef std::map<NamePair,unsigned int> NameMap;
|
||||
typedef std::vector< std::string > Words;
|
||||
|
||||
int main( int argc, char** argv)
|
||||
NamePair EmptyNamePair;
|
||||
NamePair NameRobertOsfield("Robert","Osfield");
|
||||
NamePair NameDonBurns("Don","Burns");
|
||||
|
||||
bool validName(const std::string& first)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName() + " [options]");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--version-number", "Print out version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--major-number", "Print out major version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--minor-number", "Print out minor version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--patch-number", "Print out patch version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--so-number ", "Print out shared object version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number", "Print out version number for OpenThreads only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number", "Print out shared object version number for OpenThreads only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type", "Print the value of Matrix::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
|
||||
if (first=="de") return true;
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--entries", "Print out number of entries into the ChangeLog file for each contributor.");
|
||||
|
||||
if (first.empty()) return false;
|
||||
if (first[0]<'A' || first[0]>'Z') return false;
|
||||
|
||||
if (first.size()>=2 && (first[1]<'a' || first[1]>'z') && (first[1]!='.') && (first[1]!=',')) return false;
|
||||
|
||||
if (first=="Xcode") return false;
|
||||
if (first=="Added") return false;
|
||||
if (first=="Camera") return false;
|
||||
if (first=="CameraNode") return false;
|
||||
if (first=="CopyOp") return false;
|
||||
if (first=="Fixed") return false;
|
||||
if (first=="View") return false;
|
||||
if (first=="GraphicsContext") return false;
|
||||
if (first=="WindowData") return false;
|
||||
if (first=="ViewPoint") return false;
|
||||
if (first=="PickHandler") return false;
|
||||
if (first=="Program") return false;
|
||||
if (first=="Object") return false;
|
||||
if (first=="OpenSceneGraph") return false;
|
||||
if (first=="SpotExponent") return false;
|
||||
if (first=="Framstamp") return false;
|
||||
if (first=="Stats") return false;
|
||||
if (first=="Group") return false;
|
||||
if (first=="Texture") return false;
|
||||
if (first=="Texture2DArray") return false;
|
||||
if (first=="Creator") return false;
|
||||
if (first=="CullVisitor") return false;
|
||||
if (first=="Drawable") return false;
|
||||
if (first=="Geode") return false;
|
||||
if (first=="GeoSet") return false;
|
||||
if (first=="Image") return false;
|
||||
if (first=="Face") return false;
|
||||
if (first=="Images/SolarSystem") return false;
|
||||
if (first=="IntersectVisitor") return false;
|
||||
if (first=="LongIDRecord") return false;
|
||||
if (first=="Makefile") return false;
|
||||
if (first=="Matrix") return false;
|
||||
if (first=="MemoryManager") return false;
|
||||
if (first=="MeshRecord") return false;
|
||||
if (first=="Multigen") return false;
|
||||
if (first=="NewCullVisitor") return false;
|
||||
if (first=="Output") return false;
|
||||
if (first=="PageLOD") return false;
|
||||
if (first=="Improved") return false;
|
||||
if (first=="PagedLOD") return false;
|
||||
if (first=="Referenced") return false;
|
||||
if (first=="StateAttribute") return false;
|
||||
if (first=="Switch") return false;
|
||||
if (first=="TechniqueEventHandler") return false;
|
||||
if (first=="Uniform") return false;
|
||||
if (first=="Vec*") return false;
|
||||
if (first=="Viewer") return false;
|
||||
if (first=="VisualStudio") return false;
|
||||
if (first=="X") return false;
|
||||
if (first=="Y") return false;
|
||||
if (first=="Producer") return false;
|
||||
if (first=="New") return false;
|
||||
if (first=="Removed") return false;
|
||||
if (first=="Ouput") return false;
|
||||
if (first=="ReaderWriters") return false;
|
||||
if (first=="NodeVisitor") return false;
|
||||
if (first=="Fixes") return false;
|
||||
if (first=="FontImplementation") return false;
|
||||
if (first=="DisplaySettings") return false;
|
||||
if (first=="AnimationPath") return false;
|
||||
if (first=="AnimationPathCallback") return false;
|
||||
if (first=="AnimationPathManipulator") return false;
|
||||
if (first=="ArgumentParser") return false;
|
||||
if (first=="AttrData") return false;
|
||||
if (first=="Azimuth") return false;
|
||||
if (first=="CluserCullingCallback") return false;
|
||||
if (first=="ClusterCullingCallback") return false;
|
||||
if (first=="CoordinateSystem") return false;
|
||||
if (first=="CoordinateSystemNode") return false;
|
||||
if (first=="CoordinateSystemNode&") return false;
|
||||
if (first=="Copyright") return false;
|
||||
if (first=="Cygwin") return false;
|
||||
if (first=="CullCallbacks") return false;
|
||||
if (first=="CullingSettngs") return false;
|
||||
if (first=="DataVariance") return false;
|
||||
if (first=="DatabasePager") return false;
|
||||
if (first=="DrawElementsUByte") return false;
|
||||
if (first=="Escape") return false;
|
||||
if (first=="FluidProgram") return false;
|
||||
if (first=="FrameStats") return false;
|
||||
if (first=="FreeBSD") return false;
|
||||
if (first=="GraphicsContextImplementation") return false;
|
||||
if (first=="GraphicsThread") return false;
|
||||
if (first=="Images") return false;
|
||||
if (first=="IndexBlock") return false;
|
||||
if (first=="Inventor") return false;
|
||||
if (first=="Make") return false;
|
||||
if (first=="Material") return false;
|
||||
if (first=="MergeGeometryVisitor") return false;
|
||||
if (first=="Mode") return false;
|
||||
if (first=="Prodcuer") return false;
|
||||
if (first=="ProxyNode") return false;
|
||||
if (first=="ReentrantMutex") return false;
|
||||
if (first=="ReferenceFrame") return false;
|
||||
if (first=="RemoveLoadedProxyNodes") return false;
|
||||
if (first=="RenderTargetFallback") return false;
|
||||
if (first=="RenderToTextureStage") return false;
|
||||
if (first=="Sequence") return false;
|
||||
if (first=="Shape") return false;
|
||||
if (first=="TessellationHints") return false;
|
||||
if (first=="Support") return false;
|
||||
if (first=="State") return false;
|
||||
if (first=="SmokeTrailEffect") return false;
|
||||
if (first=="TexEnv") return false;
|
||||
if (first=="Texture3D") return false;
|
||||
if (first=="TextureCubeMap") return false;
|
||||
if (first=="TextureObjectManager") return false;
|
||||
if (first=="TextureRectangle(Image*") return false;
|
||||
if (first=="TextureType") return false;
|
||||
if (first=="Texuture") return false;
|
||||
if (first=="TriStripVisitor") return false;
|
||||
if (first=="UserData") return false;
|
||||
if (first=="Viewport") return false;
|
||||
if (first=="Visual") return false;
|
||||
if (first=="Studio") return false;
|
||||
if (first=="Vec2d") return false;
|
||||
if (first=="Vec3d") return false;
|
||||
if (first=="Windows") return false;
|
||||
if (first=="Version") return false;
|
||||
if (first=="Viewport") return false;
|
||||
if (first=="Core") return false;
|
||||
if (first=="DataSet") return false;
|
||||
if (first=="Endian") return false;
|
||||
if (first=="ImageOptions") return false;
|
||||
if (first=="ImageStream") return false;
|
||||
if (first=="KeyboardMouse") return false;
|
||||
if (first=="KeyboardMouseCallback") return false;
|
||||
if (first=="AutoTransform") return false;
|
||||
if (first=="AutoTransform.") return false;
|
||||
if (first=="LightModel") return false;
|
||||
if (first=="MatrixManipulator") return false;
|
||||
if (first=="MatrixTransform") return false;
|
||||
if (first=="OpenDX") return false;
|
||||
if (first=="ParentList") return false;
|
||||
if (first=="TerraPage") return false;
|
||||
if (first=="OveralyNode") return false;
|
||||
if (first=="OpenThreads") return false;
|
||||
if (first=="PolygonStipple") return false;
|
||||
if (first=="SceneView") return false;
|
||||
if (first=="PrimitiveIndexFunctor") return false;
|
||||
if (first=="PolytopeVisitor") return false;
|
||||
if (first=="Performer") return false;
|
||||
if (first=="Paging") return false;
|
||||
if (first=="CameraBarrierCallback") return false;
|
||||
if (first=="TestSupportCallback") return false;
|
||||
if (first=="Quake3") return false;
|
||||
if (first=="BlenColour(Vec4") return false;
|
||||
if (first=="UseFarLineSegments") return false;
|
||||
if (first=="TextureRectangle") return false;
|
||||
if (first=="DeleteHandler") return false;
|
||||
if (first=="EventQueue") return false;
|
||||
if (first=="TrPageViewer") return false;
|
||||
if (first=="TestManipulator") return false;
|
||||
if (first=="ProducerEventCallback") return false;
|
||||
if (first=="OrientationConverter") return false;
|
||||
if (first=="Logos") return false;
|
||||
if (first=="StatsVisitor") return false;
|
||||
if (first=="LineStipple") return false;
|
||||
if (first=="Files") return false;
|
||||
if (first=="Mr") return false;
|
||||
if (first=="Osfields") return false;
|
||||
if (first=="Optimizer") return false;
|
||||
if (first=="RenderStage") return false;
|
||||
if (first=="Matrix*") return false;
|
||||
if (first=="Vec4ub") return false;
|
||||
if (first=="Proxy") return false;
|
||||
if (first=="CullVistor") return false;
|
||||
if (first=="SimpleViewer") return false;
|
||||
if (first=="TexMat(Matrix") return false;
|
||||
if (first=="GraphicsWindowX11") return false;
|
||||
if (first=="OperationThread") return false;
|
||||
if (first=="SimpleViewer") return false;
|
||||
if (first=="IndexFaceSets") return false;
|
||||
if (first=="Quicktime") return false;
|
||||
if (first=="SceneGraphBuilder") return false;
|
||||
if (first=="LightPointNode") return false;
|
||||
if (first=="GeometryTechnique") return false;
|
||||
if (first=="GeoemtryTechnique") return false;
|
||||
if (first=="KdTree") return false;
|
||||
if (first=="LineSegment") return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string typoCorrection(const std::string& name)
|
||||
{
|
||||
#if 0
|
||||
if (name=="") return "";
|
||||
if (name=="") return "";
|
||||
if (name=="") return "";
|
||||
if (name=="") return "";
|
||||
#endif
|
||||
if (name=="Weidemann") return "Wiedemann";
|
||||
if (name=="Martsz") return "Martz";
|
||||
if (name=="Matz") return "Martz";
|
||||
if (name=="Froenlich") return "Fr<EFBFBD>hlich";
|
||||
if (name=="Froechlich") return "Fr<EFBFBD>hlich";
|
||||
if (name=="Froelich") return "Fr<EFBFBD>hlich";
|
||||
if (name=="Fruciel") return "Frauciel";
|
||||
if (name=="Hebelin") return "Herbelin";
|
||||
if (name=="Jea-Sebastien") return "Jean-Sebastien";
|
||||
if (name=="Jean-Sebastian") return "Jean-Sebastien";
|
||||
if (name=="Robet") return "Robert";
|
||||
if (name=="Morné") return "Morn<EFBFBD>";
|
||||
if (name=="Adndre") return "Andre";
|
||||
if (name=="Mellis") return "Melis";
|
||||
if (name=="Rajce") return "Trajce";
|
||||
if (name=="Trastenjak") return "Trstenjak";
|
||||
if (name=="Baverage") return "Beverage";
|
||||
if (name=="Bistroviae") return "Bistrovic";
|
||||
if (name=="Christaiansen") return "Christiansen";
|
||||
if (name=="Cobin") return "Corbin";
|
||||
if (name=="Connel") return "Connell";
|
||||
if (name=="Daust") return "Daoust";
|
||||
if (name=="Lugi") return "Luigi";
|
||||
if (name=="Daved") return "David";
|
||||
if (name=="Fred") return "Frederic";
|
||||
if (name=="Drederic") return "Frederic";
|
||||
if (name=="Fredrick") return "Frederic";
|
||||
if (name=="Fredric") return "Frederic";
|
||||
if (name=="Garrat") return "Garrett";
|
||||
if (name=="Geof") return "Geoff";
|
||||
if (name=="Gronenger") return "Gronager";
|
||||
if (name=="Gronger") return "Gronager";
|
||||
if (name=="Heirtlein") return "Hertlein";
|
||||
if (name=="Heirtlein") return "Hertlein";
|
||||
if (name=="Heirtlein") return "Hertlein";
|
||||
if (name=="Hertlien") return "Hertlein";
|
||||
if (name=="Narache") return "Marache";
|
||||
if (name=="Hi") return "He";
|
||||
if (name=="Hooper") return "Hopper";
|
||||
if (name=="Inverson") return "Iverson";
|
||||
if (name=="Iversion") return "Iverson";
|
||||
if (name=="Jeoen") return "Joran";
|
||||
if (name=="Johhansen") return "Johansen";
|
||||
if (name=="Johnansen") return "Johansen";
|
||||
if (name=="Johnasen") return "Johansen";
|
||||
if (name=="Jolly") return "Jolley";
|
||||
if (name=="Jose") return "Jos<EFBFBD>";
|
||||
if (name=="Joson") return "Jason";
|
||||
if (name=="J") return "Jos<EFBFBD>";
|
||||
if (name=="Keuhne") return "Kuehne";
|
||||
if (name=="Kheune") return "Kuehne";
|
||||
if (name=="Lashakari") return "Lashkari";
|
||||
if (name=="Lashari") return "Lashkari";
|
||||
if (name=="Lasharki") return "Lashkari";
|
||||
if (name=="Laskari") return "Lashkari";
|
||||
if (name=="Macro") return "Marco";
|
||||
if (name=="Mammond") return "Marmond";
|
||||
if (name=="March") return "Marco";
|
||||
if (name=="Marz") return "Martz";
|
||||
if (name=="Micheal") return "Michael";
|
||||
if (name=="Molishtan") return "Moloshtan";
|
||||
if (name=="Molishtan") return "Moloshtan";
|
||||
if (name=="Moloshton") return "Moloshtan";
|
||||
if (name=="Moule") return "Moiule";
|
||||
if (name=="Nicklov") return "Nikolov";
|
||||
if (name=="Nickolov") return "Nikolov";
|
||||
if (name=="Olad") return "Olaf";
|
||||
if (name=="Olar") return "Olaf";
|
||||
if (name=="Oritz") return "Ortiz";
|
||||
if (name=="Osfied") return "Osfield";
|
||||
if (name=="Pail") return "Paul";
|
||||
if (name=="Randal") return "Randall";
|
||||
if (name=="Rodger") return "Roger";
|
||||
if (name=="Sewel") return "Sewell";
|
||||
if (name=="Sjolie") return "Sj<EFBFBD>lie";
|
||||
if (name=="Sokolosky") return "Sokolowsky";
|
||||
if (name=="Sokolowski") return "Sokolowsky";
|
||||
if (name=="Sokolsky") return "Sokolowsky";
|
||||
if (name=="Sonda") return "Sondra";
|
||||
if (name=="Stansilav") return "Stanislav";
|
||||
if (name=="Stefan") return "Stephan";
|
||||
if (name=="Stell") return "Steel";
|
||||
if (name=="Takeahei") return "Takahei";
|
||||
if (name=="Takehei") return "Takahei";
|
||||
if (name=="Tarantilils") return "Tarantilis";
|
||||
if (name=="Vines") return "Vine";
|
||||
if (name=="Wieblen") return "Weiblen";
|
||||
if (name=="Xennon") return "Hanson";
|
||||
if (name=="Yefrei") return "Yefei";
|
||||
if (name=="Yfei") return "Yefei";
|
||||
if (name=="Antonoine") return "Antoine";
|
||||
if (name=="Antione") return "Antoine";
|
||||
if (name=="Andew") return "Andrew";
|
||||
if (name=="Daneil") return "Daniel";
|
||||
if (name=="André") return "Andr<EFBFBD>";
|
||||
if (name=="García") return "Garcea";
|
||||
if (name=="Sjölie") return "Sj<EFBFBD>lie";
|
||||
if (name=="José") return "Jos<EFBFBD>";
|
||||
if (name=="Fröhlich") return "Fr<EFBFBD>hlich";
|
||||
if (name=="Froehlich") return "Fr<EFBFBD>hlich";
|
||||
if (name=="Eileman") return "Eilemann";
|
||||
if (name=="Skinnder") return "Skinner";
|
||||
if (name=="Mihair") return "Mihai";
|
||||
if (name=="Mahai") return "Mihai";
|
||||
if (name=="Wojiech" || name=="Wojchiech") return "Wojciech";
|
||||
if (name=="Leandowski" || name=="Lawandowski") return "Lewandowski";
|
||||
if (name=="Aderian") return "Adrian";
|
||||
if (name=="Callue") return "Callu";
|
||||
if (name=="Waldrom") return "Waldron";
|
||||
if (name=="Atr") return "Art";
|
||||
if (name=="Sylvan") return "Sylvain";
|
||||
if (name=="Giatan") return "Gaitan";
|
||||
if (name=="Melchoir") return "Melchior";
|
||||
if (name=="Simmonsson") return "Simonsson";
|
||||
if (name=="Simmonson") return "Simonsson";
|
||||
if (name=="Sokolwsky") return "Sokolowsky";
|
||||
if (name=="Cullu") return "Callu";
|
||||
if (name=="Comporesi") return "Camporesi";
|
||||
if (name=="Machler") return "M<EFBFBD>chler";
|
||||
if (name=="Maechler") return "M<EFBFBD>chler";
|
||||
if (name=="Messerschimdt") return "Messerschmidt";
|
||||
if (name=="Garret") return "Garrett";
|
||||
if (name=="Adrain") return "Adrian";
|
||||
if (name=="Elgi") return "Egli";
|
||||
return name;
|
||||
}
|
||||
|
||||
// if user request help write it out to cout.
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
void nameCorrection(NamePair& name)
|
||||
{
|
||||
if (name.first=="John" && name.second=="Vidar")
|
||||
{
|
||||
cout << arguments.getApplicationUsage()->getCommandLineUsage() << endl;
|
||||
arguments.getApplicationUsage()->write(cout, arguments.getApplicationUsage()->getCommandLineOptions());
|
||||
return 1;
|
||||
name.first = "John";
|
||||
name.second = "Vidar Larring";
|
||||
}
|
||||
|
||||
if (name.first=="Sebastien" && name.second=="Messerschmidt")
|
||||
{
|
||||
name.first = "Sebastian";
|
||||
name.second = "Messerschmidt";
|
||||
}
|
||||
|
||||
if ((name.first=="Jose" || name.first=="Jos<EFBFBD>") && name.second=="Delport")
|
||||
{
|
||||
name.first = "J.P.";
|
||||
name.second = "Delport";
|
||||
}
|
||||
if (name.first=="Franz" && name.second=="Melchior")
|
||||
{
|
||||
name.first = "Melchior";
|
||||
name.second = "Franz";
|
||||
}
|
||||
if (name.first=="Glen" && name.second=="Waldon")
|
||||
{
|
||||
name.first = "Glenn";
|
||||
name.second = "Waldron";
|
||||
}
|
||||
if (name.first=="Ralf" && name.second=="Karn")
|
||||
{
|
||||
name.first = "Ralf";
|
||||
name.second = "Kern";
|
||||
}
|
||||
if (name.first=="Donny" && name.second=="Cipperly")
|
||||
{
|
||||
name.first = "Donald";
|
||||
name.second = "Cipperly";
|
||||
}
|
||||
if (name.first=="Gino" && name.second=="")
|
||||
{
|
||||
name.first = "Gino";
|
||||
name.second = "van den Bergen";
|
||||
}
|
||||
if (name.first=="Radu" && name.second=="Mihai")
|
||||
{
|
||||
name.first = "Mihai";
|
||||
name.second = "Radu";
|
||||
}
|
||||
if (name.first=="Art" && name.second=="Trevs")
|
||||
{
|
||||
name.first = "Art";
|
||||
name.second = "Tevs";
|
||||
}
|
||||
if (name.first=="Tim" && name.second=="More")
|
||||
{
|
||||
name.first = "Tim";
|
||||
name.second = "Moore";
|
||||
}
|
||||
if (name.first=="Andre" && name.second=="Garneau")
|
||||
{
|
||||
name.first = "Andr<EFBFBD>";
|
||||
name.second = "Garneau";
|
||||
}
|
||||
if (name.first=="Eric" && name.second=="Hammil")
|
||||
{
|
||||
name.first = "Chris";
|
||||
name.second = "Hanson";
|
||||
}
|
||||
if (name.first=="Paul" && name.second=="de")
|
||||
{
|
||||
name.first = "Paul";
|
||||
name.second = "de Repentigny";
|
||||
}
|
||||
if (name.first=="Raymond" && name.second=="de")
|
||||
{
|
||||
name.first = "Raymond";
|
||||
name.second = "de Vries";
|
||||
}
|
||||
if (name.first=="Nick" && name.second=="")
|
||||
{
|
||||
name.first = "Trajce";
|
||||
name.second = "Nikolov";
|
||||
}
|
||||
if (name.first=="Daniel" && name.second=="")
|
||||
{
|
||||
name.first = "Daniel";
|
||||
name.second = "Sj<EFBFBD>lie";
|
||||
}
|
||||
if (name.first=="Julia" && name.second=="Ortiz")
|
||||
{
|
||||
name.first = "Julian";
|
||||
name.second = "Ortiz";
|
||||
}
|
||||
if (name.first=="Rune" && name.second=="Schmidt")
|
||||
{
|
||||
name.first = "Rune";
|
||||
name.second = "Schmidt Jensen";
|
||||
}
|
||||
if (name.first=="Romano" && name.second=="Jos<EFBFBD>")
|
||||
{
|
||||
name.first = "Romano";
|
||||
name.second = "Jos<EFBFBD> Magacho da Silva";
|
||||
}
|
||||
if (name.first=="Rommano" && name.second=="Silva")
|
||||
{
|
||||
name.first = "Romano";
|
||||
name.second = "Jos<EFBFBD> Magacho da Silva";
|
||||
}
|
||||
if (name.first=="Leandro" && name.second=="Motta")
|
||||
{
|
||||
name.first = "Leandro";
|
||||
name.second = "Motta Barros";
|
||||
}
|
||||
if (name.first=="A" && name.second=="Botorabi")
|
||||
{
|
||||
name.first = "Ali";
|
||||
name.second = "Botorabi";
|
||||
}
|
||||
|
||||
if (name.first=="Waltice" && name.second=="")
|
||||
{
|
||||
name.first = "Walter";
|
||||
name.second = "J. Altice";
|
||||
}
|
||||
|
||||
if (name.first=="Drew" && name.second=="")
|
||||
{
|
||||
name.first = "Drew";
|
||||
name.second = "Whitehouse";
|
||||
}
|
||||
if (name.first=="Douglas" && name.second=="A")
|
||||
{
|
||||
name.first = "Douglas";
|
||||
name.second = "A. Pouk";
|
||||
}
|
||||
if (name.first=="Colin" && name.second=="MacDonald")
|
||||
{
|
||||
name.first = "Colin";
|
||||
name.second = "McDonald";
|
||||
}
|
||||
if (name.first=="Nikolov" && name.second=="Trajce")
|
||||
{
|
||||
name.first = "Trajce";
|
||||
name.second = "Nikolov";
|
||||
}
|
||||
if (name.first=="Frauciel" && name.second=="Luc")
|
||||
{
|
||||
name.first = "Luc";
|
||||
name.second = "Frauciel";
|
||||
}
|
||||
}
|
||||
|
||||
void lastValidCharacter(const std::string& name, unsigned int& pos,char c)
|
||||
{
|
||||
for(unsigned int i=0;i<pos;++i)
|
||||
{
|
||||
if (name[i]==c)
|
||||
{
|
||||
pos = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lastValidCharacter(const std::string& name, unsigned int& last)
|
||||
{
|
||||
lastValidCharacter(name, last, '.');
|
||||
lastValidCharacter(name, last, ',');
|
||||
lastValidCharacter(name, last, '\'');
|
||||
lastValidCharacter(name, last, '/');
|
||||
lastValidCharacter(name, last, '\\');
|
||||
lastValidCharacter(name, last, ':');
|
||||
lastValidCharacter(name, last, ';');
|
||||
lastValidCharacter(name, last, ')');
|
||||
}
|
||||
|
||||
|
||||
|
||||
NamePair createName(const std::string& first, const std::string& second)
|
||||
{
|
||||
if (first.empty()) return EmptyNamePair;
|
||||
|
||||
unsigned int last = first.size();
|
||||
lastValidCharacter(first, last);
|
||||
|
||||
if (last==0) return EmptyNamePair;
|
||||
|
||||
std::string name;
|
||||
|
||||
name.append(first.begin(), first.begin()+last);
|
||||
|
||||
if (!validName(name)) return EmptyNamePair;
|
||||
|
||||
name = typoCorrection(name);
|
||||
|
||||
if (second.empty() ||
|
||||
!validName(second))
|
||||
{
|
||||
// filter any single or two letter words as unlike to be names.
|
||||
if (name.size()<=2) return EmptyNamePair;
|
||||
|
||||
return NamePair(name,"");
|
||||
}
|
||||
|
||||
last = second.size();
|
||||
|
||||
lastValidCharacter(second, last);
|
||||
|
||||
if (last>0)
|
||||
{
|
||||
std::string surname(second.begin(), second.begin()+last);
|
||||
|
||||
if (validName(surname))
|
||||
{
|
||||
surname = typoCorrection(surname);
|
||||
return NamePair(name, surname);
|
||||
}
|
||||
}
|
||||
|
||||
// filter any single or two letter words as unlike to be names.
|
||||
if (name.size()<=2) return EmptyNamePair;
|
||||
|
||||
return NamePair(name,"");
|
||||
}
|
||||
|
||||
bool submissionsSequence(const Words& words, unsigned int& i)
|
||||
{
|
||||
if (i+1>=words.size()) return false;
|
||||
|
||||
if (words[i]=="From" ||
|
||||
words[i]=="from" ||
|
||||
words[i]=="From:" ||
|
||||
words[i]=="from:" ||
|
||||
words[i]=="Merged" ||
|
||||
words[i]=="Integrated") return true;
|
||||
|
||||
if (i+2>=words.size()) return false;
|
||||
|
||||
if (words[i]=="submitted" && words[i+1]=="by")
|
||||
{
|
||||
i+=1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i]=="Folded" && words[i+1]=="in")
|
||||
{
|
||||
i+=1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i]=="Rolled" && words[i+1]=="in")
|
||||
{
|
||||
i+=1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (words[i]=="Checked" && words[i+1]=="in")
|
||||
{
|
||||
i+=1;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i+3>=words.size()) return false;
|
||||
|
||||
if (words[i]=="sent" && words[i+1]=="in" && words[i+2]=="by")
|
||||
{
|
||||
i+=2;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void readContributors(NameMap& names, const std::string& file)
|
||||
{
|
||||
std::ifstream fin(file.c_str());
|
||||
|
||||
Words words;
|
||||
while(fin)
|
||||
{
|
||||
std::string keyword;
|
||||
fin >> keyword;
|
||||
words.push_back(keyword);
|
||||
}
|
||||
|
||||
std::string blank_string;
|
||||
|
||||
for(unsigned int i=0; i< words.size(); ++i)
|
||||
{
|
||||
if (submissionsSequence(words,i))
|
||||
{
|
||||
if (i+2<words.size() && validName(words[i+1]))
|
||||
{
|
||||
NamePair name = createName(words[i+1], words[i+2]);
|
||||
nameCorrection(name);
|
||||
if (!name.first.empty()) ++names[name];
|
||||
i+=2;
|
||||
}
|
||||
else if (i+1<words.size() && validName(words[i+1]))
|
||||
{
|
||||
NamePair name = createName(words[i+1], blank_string);
|
||||
nameCorrection(name);
|
||||
if (!name.first.empty()) ++names[name];
|
||||
i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (words[i]=="robert:")
|
||||
{
|
||||
++names[NameRobertOsfield];
|
||||
}
|
||||
else if (words[i]=="don:")
|
||||
{
|
||||
++names[NameDonBurns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reassign fisrt name entries to their full names entries
|
||||
if (names.size()>1)
|
||||
{
|
||||
for(NameMap::iterator itr = names.begin();
|
||||
itr != names.end();
|
||||
)
|
||||
{
|
||||
if (itr->first.second.empty())
|
||||
{
|
||||
NameMap::iterator next_itr = itr;
|
||||
++next_itr;
|
||||
|
||||
if (next_itr!=names.end() && itr->first.first==next_itr->first.first)
|
||||
{
|
||||
next_itr->second += itr->second;
|
||||
names.erase(itr);
|
||||
itr = next_itr;
|
||||
}
|
||||
else
|
||||
{
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove the double entries from Robert's contributions
|
||||
if (names.size()>1)
|
||||
{
|
||||
for(NameMap::iterator itr = names.begin();
|
||||
itr != names.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns )
|
||||
{
|
||||
names[NameRobertOsfield] -= itr->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void buildContributors(NameMap& names)
|
||||
{
|
||||
// top five contributors
|
||||
++names[NamePair("Robert","Osfield")];
|
||||
++names[NamePair("Don","Burns")];
|
||||
++names[NamePair("Marco","Jez")];
|
||||
++names[NamePair("Mike","Weiblen")];
|
||||
++names[NamePair("Geoff","Michel")];
|
||||
++names[NamePair("Ben","van Basten")];
|
||||
|
||||
// contributors that don't appear in the ChangeLog due to their contributions
|
||||
// being before CVS started for the OSG, or before the name logging began.
|
||||
++names[NamePair("Karsten","Weiss")];
|
||||
++names[NamePair("Graeme","Harkness")];
|
||||
++names[NamePair("Axel","Volley")];
|
||||
++names[NamePair("Nikolaus","Hanekamp")];
|
||||
++names[NamePair("Kristopher","Bixler")];
|
||||
++names[NamePair("Tanguy","Fautr<EFBFBD>")];
|
||||
++names[NamePair("J.E.","Hoffmann")];
|
||||
}
|
||||
|
||||
int main( int argc, char **argv)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--major-number","Print out major version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--minor-number","Print out minor version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--patch-number","Print out patch version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--so-number ","Print out shared object version number only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type","Print the value of Matrix::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type","Print the value of Plane::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type","Print the value of BoundingSphere::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type","Print the value of BoundingBox::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list.");
|
||||
|
||||
if (arguments.read("--version-number"))
|
||||
{
|
||||
cout << osgGetVersion() << endl;
|
||||
std::cout<<osgGetVersion()<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--major-number"))
|
||||
{
|
||||
cout << OPENSCENEGRAPH_MAJOR_VERSION << endl;
|
||||
std::cout<<OPENSCENEGRAPH_MAJOR_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--minor-number"))
|
||||
{
|
||||
cout << OPENSCENEGRAPH_MINOR_VERSION << endl;
|
||||
std::cout<<OPENSCENEGRAPH_MINOR_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--patch-number"))
|
||||
{
|
||||
cout << OPENSCENEGRAPH_PATCH_VERSION << endl;
|
||||
std::cout<<OPENSCENEGRAPH_PATCH_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--soversion-number") || arguments.read("--so-number") )
|
||||
{
|
||||
cout << osgGetSOVersion() << endl;
|
||||
std::cout<<osgGetSOVersion()<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--openthreads-version-number"))
|
||||
{
|
||||
cout << OpenThreadsGetVersion() << endl;
|
||||
std::cout<<OpenThreadsGetVersion()<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (arguments.read("--openthreads-major-number"))
|
||||
{
|
||||
cout << OPENTHREADS_MAJOR_VERSION << endl;
|
||||
std::cout<<OPENTHREADS_MAJOR_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--openthreads-minor-number"))
|
||||
{
|
||||
cout << OPENTHREADS_MINOR_VERSION << endl;
|
||||
std::cout<<OPENTHREADS_MINOR_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("--openthreads-patch-number"))
|
||||
{
|
||||
cout << OPENTHREADS_PATCH_VERSION << endl;
|
||||
std::cout<<OPENTHREADS_PATCH_VERSION<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("--openthreads-soversion-number"))
|
||||
{
|
||||
cout << OpenThreadsGetSOVersion() << endl;
|
||||
std::cout<<OpenThreadsGetSOVersion()<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("Matrix::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::Matrix::value_type) == 4) ? "float" : "double") << endl;
|
||||
std::cout<<((sizeof(osg::Matrix::value_type)==4)?"float":"double")<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("Plane::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::Plane::value_type) == 4) ? "float" : "double") << endl;
|
||||
std::cout<<((sizeof(osg::Plane::value_type)==4)?"float":"double")<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("BoundingSphere::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::BoundingSphere::value_type) == 4) ? "float" : "double") << endl;
|
||||
std::cout<<((sizeof(osg::BoundingSphere::value_type)==4)?"float":"double")<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("BoundingBox::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::BoundingBox::value_type) == 4) ? "float" : "double") << endl;
|
||||
std::cout<<((sizeof(osg::BoundingBox::value_type)==4)?"float":"double")<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::cout<<osgGetLibraryName()<< " "<< osgGetVersion()<<std::endl<<std::endl;
|
||||
|
||||
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
string changeLog;
|
||||
while (arguments.read("-r", changeLog) ||
|
||||
arguments.read("--read", changeLog))
|
||||
bool printContributors = false;
|
||||
bool printNumEntries = false;
|
||||
while ( arguments.read("--entries"))
|
||||
{
|
||||
printContributors(changeLog, arguments.read("--entries"));
|
||||
printContributors = true;
|
||||
printNumEntries = true;
|
||||
}
|
||||
|
||||
std::string changeLog;
|
||||
while ( arguments.read("-r",changeLog) || arguments.read("--read",changeLog)) printContributors = true;
|
||||
|
||||
// if user request help write it out to cout.
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
{
|
||||
std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl;
|
||||
arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (printContributors)
|
||||
{
|
||||
NameMap names;
|
||||
buildContributors(names);
|
||||
if (!changeLog.empty())
|
||||
{
|
||||
readContributors(names, changeLog);
|
||||
}
|
||||
|
||||
typedef std::multimap<unsigned int, NamePair> SortedNameMap;
|
||||
|
||||
SortedNameMap sortedNames;
|
||||
for(NameMap::iterator itr = names.begin();
|
||||
itr != names.end();
|
||||
++itr)
|
||||
{
|
||||
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
|
||||
}
|
||||
|
||||
std::cout<<names.size()<<" Contributors:"<<std::endl<<std::endl;
|
||||
|
||||
if (printNumEntries)
|
||||
{
|
||||
std::cout<<"Entries Firstname Surname"<<std::endl;
|
||||
std::cout<<"-------------------------"<<std::endl;
|
||||
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
||||
sitr != sortedNames.rend();
|
||||
++sitr)
|
||||
{
|
||||
std::cout<<sitr->first<<"\t"<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"Firstname Surname"<<std::endl;
|
||||
std::cout<<"-----------------"<<std::endl;
|
||||
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
||||
sitr != sortedNames.rend();
|
||||
++sitr)
|
||||
{
|
||||
std::cout<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
2
configure
vendored
2
configure
vendored
@@ -1 +1 @@
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release $@
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -348,7 +348,7 @@ SHOW_USED_FILES = YES
|
||||
# The QUIET tag can be used to turn on/off the messages that are generated
|
||||
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
||||
|
||||
QUIET = YES
|
||||
QUIET = NO
|
||||
|
||||
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||
# generated by doxygen. Possible values are YES and NO. If left blank
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,6 @@
|
||||
<hr>
|
||||
<table border="0"><tr><td>
|
||||
<img src="osg32-32.png" alt="osg logo" />
|
||||
</td><td>
|
||||
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">$projectname</a>
|
||||
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">OpenSceneGraph</a>
|
||||
by <a href="http://www.doxygen.org">doxygen</a> $doxygenversion.</small></address>
|
||||
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the OpenSceneGraph -->
|
||||
</td></tr></table>
|
||||
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the Open Scene Graph -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,254 +0,0 @@
|
||||
# Doxyfile 1.5.7.1
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = OpenThreads
|
||||
PROJECT_NUMBER = ${OPENTHREADS_VERSION}
|
||||
OUTPUT_DIRECTORY = "${PROJECT_BINARY_DIR}/doc/"
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
IDL_PROPERTY_SUPPORT = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
SYMBOL_CACHE_SIZE = 0
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/OpenThreads"
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *include* \
|
||||
*.cpp
|
||||
RECURSIVE = YES
|
||||
EXCLUDE = .svn
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = */.svn/*
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 2
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = OpenThreadsReferenceDocs
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
GENERATE_DOCSET = NO
|
||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||
GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
|
||||
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
|
||||
HHC_LOCATION = "${HTML_HELP_COMPILER}"
|
||||
GENERATE_CHI = NO
|
||||
CHM_INDEX_ENCODING =
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
GENERATE_QHP = NO
|
||||
QCH_FILE =
|
||||
QHP_NAMESPACE = org.doxygen.Project
|
||||
QHP_VIRTUAL_FOLDER = doc
|
||||
QHG_LOCATION =
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
FORMULA_FONTSIZE = 10
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
DOT_FONTNAME = FreeSans
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_FONTPATH =
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = YES
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = ${SEARCHENGINE}
|
||||
@@ -16,9 +16,7 @@ SET(TARGET_COMMON_LIBRARIES
|
||||
|
||||
IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
ADD_SUBDIRECTORY(osg2cpp)
|
||||
ADD_SUBDIRECTORY(osganimate)
|
||||
ADD_SUBDIRECTORY(osgautocapture)
|
||||
ADD_SUBDIRECTORY(osgautotransform)
|
||||
ADD_SUBDIRECTORY(osgbillboard)
|
||||
ADD_SUBDIRECTORY(osgblendequation)
|
||||
@@ -30,16 +28,13 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgcopy)
|
||||
ADD_SUBDIRECTORY(osgcubemap)
|
||||
ADD_SUBDIRECTORY(osgdelaunay)
|
||||
ADD_SUBDIRECTORY(osgcluster)
|
||||
ADD_SUBDIRECTORY(osgdepthpartition)
|
||||
ADD_SUBDIRECTORY(osgdepthpeeling)
|
||||
ADD_SUBDIRECTORY(osgdrawinstanced)
|
||||
ADD_SUBDIRECTORY(osgdistortion)
|
||||
ADD_SUBDIRECTORY(osgfadetext)
|
||||
ADD_SUBDIRECTORY(osgfont)
|
||||
ADD_SUBDIRECTORY(osgforest)
|
||||
ADD_SUBDIRECTORY(osgfxbrowser)
|
||||
ADD_SUBDIRECTORY(osggameoflife)
|
||||
ADD_SUBDIRECTORY(osggeodemo)
|
||||
ADD_SUBDIRECTORY(osggeometry)
|
||||
ADD_SUBDIRECTORY(osggeometryshaders)
|
||||
@@ -64,7 +59,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgmultitexturecontrol)
|
||||
ADD_SUBDIRECTORY(osgoccluder)
|
||||
ADD_SUBDIRECTORY(osgocclusionquery)
|
||||
ADD_SUBDIRECTORY(osgpackeddepthstencil)
|
||||
ADD_SUBDIRECTORY(osgpagedlod)
|
||||
ADD_SUBDIRECTORY(osgparametric)
|
||||
ADD_SUBDIRECTORY(osgparticle)
|
||||
@@ -78,7 +72,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgprerender)
|
||||
ADD_SUBDIRECTORY(osgprerendercubemap)
|
||||
ADD_SUBDIRECTORY(osgreflect)
|
||||
ADD_SUBDIRECTORY(osgrobot)
|
||||
ADD_SUBDIRECTORY(osgscalarbar)
|
||||
ADD_SUBDIRECTORY(osgscreencapture)
|
||||
ADD_SUBDIRECTORY(osgscribe)
|
||||
@@ -90,7 +83,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgsharedarray)
|
||||
ADD_SUBDIRECTORY(osgsimplifier)
|
||||
ADD_SUBDIRECTORY(osgsimulation)
|
||||
ADD_SUBDIRECTORY(osgsidebyside)
|
||||
ADD_SUBDIRECTORY(osgslice)
|
||||
ADD_SUBDIRECTORY(osgspacewarp)
|
||||
ADD_SUBDIRECTORY(osgspheresegment)
|
||||
@@ -107,40 +99,11 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgtexture3D)
|
||||
ADD_SUBDIRECTORY(osgtexturerectangle)
|
||||
ADD_SUBDIRECTORY(osgthirdpersonview)
|
||||
ADD_SUBDIRECTORY(osgunittests)
|
||||
ADD_SUBDIRECTORY(osgvertexprogram)
|
||||
ADD_SUBDIRECTORY(osgvolume)
|
||||
ADD_SUBDIRECTORY(osgwindows)
|
||||
ADD_SUBDIRECTORY(osganimationhardware)
|
||||
ADD_SUBDIRECTORY(osganimationtimeline)
|
||||
ADD_SUBDIRECTORY(osganimationnode)
|
||||
ADD_SUBDIRECTORY(osganimationmakepath)
|
||||
ADD_SUBDIRECTORY(osganimationskinning)
|
||||
ADD_SUBDIRECTORY(osganimationsolid)
|
||||
ADD_SUBDIRECTORY(osganimationviewer)
|
||||
ADD_SUBDIRECTORY(osgbrowser)
|
||||
ADD_SUBDIRECTORY(osgwidgetaddremove)
|
||||
ADD_SUBDIRECTORY(osgwidgetbox)
|
||||
ADD_SUBDIRECTORY(osgwidgetcanvas)
|
||||
ADD_SUBDIRECTORY(osgwidgetframe)
|
||||
ADD_SUBDIRECTORY(osgwidgetinput)
|
||||
ADD_SUBDIRECTORY(osgwidgetlabel)
|
||||
ADD_SUBDIRECTORY(osgwidgetmessagebox)
|
||||
ADD_SUBDIRECTORY(osgwidgetmenu)
|
||||
ADD_SUBDIRECTORY(osgwidgetnotebook)
|
||||
ADD_SUBDIRECTORY(osgwidgetperformance)
|
||||
ADD_SUBDIRECTORY(osgwidgetscrolled)
|
||||
ADD_SUBDIRECTORY(osgwidgetshader)
|
||||
ADD_SUBDIRECTORY(osgwidgetstyled)
|
||||
ADD_SUBDIRECTORY(osgwidgettable)
|
||||
ADD_SUBDIRECTORY(osgwidgetwindow)
|
||||
|
||||
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||
ADD_SUBDIRECTORY(osgunittests)
|
||||
ADD_SUBDIRECTORY(osgmemorytest)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(osgpdf)
|
||||
|
||||
IF (BUILD_OSG_WRAPPERS)
|
||||
ADD_SUBDIRECTORY(osgintrospection)
|
||||
ENDIF(BUILD_OSG_WRAPPERS)
|
||||
@@ -166,12 +129,8 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ENDIF(wxWidgets_FOUND)
|
||||
|
||||
IF (QT_FOUND)
|
||||
OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON)
|
||||
|
||||
IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY)
|
||||
ADD_SUBDIRECTORY(osgviewerQT)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ADD_SUBDIRECTORY(osgviewerQT)
|
||||
ENDIF(QT_FOUND)
|
||||
|
||||
IF (FLTK_FOUND)
|
||||
ADD_SUBDIRECTORY(osgviewerFLTK)
|
||||
@@ -191,20 +150,27 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_SUBDIRECTORY(osgviewerCocoa)
|
||||
ENDIF(APPLE)
|
||||
|
||||
|
||||
|
||||
IF (LIBVNCSERVER_FOUND)
|
||||
ADD_SUBDIRECTORY(osgvnc)
|
||||
ENDIF(LIBVNCSERVER_FOUND)
|
||||
IF (BUILD_OSGWIDGET)
|
||||
ADD_SUBDIRECTORY(osgwidgetaddremove)
|
||||
ADD_SUBDIRECTORY(osgwidgetbox)
|
||||
ADD_SUBDIRECTORY(osgwidgetcanvas)
|
||||
ADD_SUBDIRECTORY(osgwidgetframe)
|
||||
ADD_SUBDIRECTORY(osgwidgetinput)
|
||||
ADD_SUBDIRECTORY(osgwidgetlabel)
|
||||
ADD_SUBDIRECTORY(osgwidgetmenu)
|
||||
ADD_SUBDIRECTORY(osgwidgetnotebook)
|
||||
ADD_SUBDIRECTORY(osgwidgetscrolled)
|
||||
ADD_SUBDIRECTORY(osgwidgetshader)
|
||||
ADD_SUBDIRECTORY(osgwidgetstyled)
|
||||
ADD_SUBDIRECTORY(osgwidgettable)
|
||||
ADD_SUBDIRECTORY(osgwidgetwindow)
|
||||
ENDIF(BUILD_OSGWIDGET)
|
||||
|
||||
|
||||
#ADD_SUBDIRECTORY(osgcegui)
|
||||
|
||||
#to add subject to find socket#ADD_SUBDIRECTORY(osgcluster)
|
||||
|
||||
ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||
#needed on win32 or the linker get confused by _declspec declarations
|
||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||
|
||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
SET(TARGET_SRC
|
||||
osg2cpp.cpp
|
||||
)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_APPLICATION(osg2cpp)
|
||||
@@ -1,102 +0,0 @@
|
||||
#include <osg/ArgumentParser>
|
||||
#include <osg/ApplicationUsage>
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/fstream>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void writeShader(osg::Shader* shader, const std::string& cppFileName, const std::string& variableName)
|
||||
{
|
||||
osgDB::ofstream fout(cppFileName.c_str());
|
||||
if (!fout)
|
||||
{
|
||||
std::cout<<"Error: could not open file `"<<cppFileName<<"` for writing."<<std::endl;
|
||||
}
|
||||
|
||||
std::string shaderSource = shader->getShaderSource();
|
||||
|
||||
std::string variableString = std::string("char ")+variableName+std::string("[] = ");
|
||||
|
||||
std::string::size_type startOfLine = 0;
|
||||
std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||
|
||||
if (endOfLine==std::string::npos)
|
||||
{
|
||||
fout<<variableString<<shaderSource<<"\\n\";"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string padding(variableString.size(),' ');
|
||||
|
||||
fout<<variableString<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
|
||||
startOfLine = endOfLine+1;
|
||||
endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||
|
||||
while (endOfLine != std::string::npos)
|
||||
{
|
||||
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
|
||||
startOfLine = endOfLine + 1;
|
||||
endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||
}
|
||||
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\";"<<std::endl;
|
||||
}
|
||||
std::cout<<"Written shader to `"<<cppFileName<<"`"<<std::endl;
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
// set up the usage document, in case we need to print out how to use this program.
|
||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
||||
|
||||
// if user request help write it out to cout.
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
{
|
||||
arguments.getApplicationUsage()->write(std::cout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string filename;
|
||||
if (arguments.read("--shader",filename))
|
||||
{
|
||||
osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename);
|
||||
if (shader.valid())
|
||||
{
|
||||
std::string name = osgDB::getStrippedName(filename);
|
||||
std::string invalidCharacters = "-+/\\*=(){}[]:;<>,.?@'~#`!\"";
|
||||
std::string numbericCharacters = "0123456789";
|
||||
std::string::size_type pos = name.find_first_of(invalidCharacters);
|
||||
while (pos != std::string::npos)
|
||||
{
|
||||
name[pos] = '_';
|
||||
pos = name.find_first_of(invalidCharacters);
|
||||
}
|
||||
|
||||
std::string ext = osgDB::getFileExtension(filename);
|
||||
std::string cppFileName = name + "_" + ext + ".cpp";
|
||||
std::string variableName = name + "_" + ext;
|
||||
writeShader(shader.get(), cppFileName, variableName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::cout<<"No appropriate command line options used."<<std::endl;
|
||||
|
||||
arguments.getApplicationUsage()->write(std::cout);
|
||||
return 1;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationhardware.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationhardware)
|
||||
@@ -1,264 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osgDB/ReadFile>
|
||||
#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 <osg/Drawable>
|
||||
#include <osg/MatrixTransform>
|
||||
|
||||
#include <osgAnimation/BasicAnimationManager>
|
||||
#include <osgAnimation/RigGeometry>
|
||||
#include <osgAnimation/RigTransformHardware>
|
||||
#include <osgAnimation/AnimationManagerBase>
|
||||
#include <osgAnimation/BoneMapVisitor>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
||||
static unsigned int getRandomValueinRange(unsigned int v)
|
||||
{
|
||||
return static_cast<unsigned int>((rand() * 1.0 * v)/(RAND_MAX-1));
|
||||
}
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Program> program;
|
||||
// show how to override the default RigTransformHardware for customized usage
|
||||
struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
|
||||
{
|
||||
|
||||
void operator()(osgAnimation::RigGeometry& geom)
|
||||
{
|
||||
if (_needInit)
|
||||
if (!init(geom))
|
||||
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;
|
||||
}
|
||||
|
||||
if (!geom.getSkeleton()) {
|
||||
osg::notify(osg::WARN) << "RigTransformHardware no skeleting set in geometry " << geom.getName() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
osgAnimation::BoneMapVisitor mapVisitor;
|
||||
geom.getSkeleton()->accept(mapVisitor);
|
||||
osgAnimation::BoneMap bm = mapVisitor.getBoneMap();
|
||||
|
||||
if (!createPalette(pos->size(),bm, geom.getVertexInfluenceSet().getVertexToBoneList()))
|
||||
return false;
|
||||
|
||||
int attribIndex = 11;
|
||||
int nbAttribs = getNumVertexAttrib();
|
||||
|
||||
// use a global program for all avatar
|
||||
if (!program.valid()) {
|
||||
program = new osg::Program;
|
||||
program->setName("HardwareSkinning");
|
||||
if (!_shader.valid())
|
||||
_shader = osg::Shader::readShaderFile(osg::Shader::VERTEX,"shaders/skinning.vert");
|
||||
|
||||
if (!_shader.valid()) {
|
||||
osg::notify(osg::WARN) << "RigTransformHardware can't load VertexShader" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// replace max matrix by the value from uniform
|
||||
{
|
||||
std::string str = _shader->getShaderSource();
|
||||
std::string toreplace = std::string("MAX_MATRIX");
|
||||
std::size_t start = str.find(toreplace);
|
||||
std::stringstream ss;
|
||||
ss << getMatrixPaletteUniform()->getNumElements();
|
||||
str.replace(start, toreplace.size(), ss.str());
|
||||
_shader->setShaderSource(str);
|
||||
osg::notify(osg::INFO) << "Shader " << str << std::endl;
|
||||
}
|
||||
|
||||
program->addShader(_shader.get());
|
||||
|
||||
for (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;
|
||||
ss << "boneWeight" << i;
|
||||
geom.setVertexAttribData(attribIndex + i, osg::Geometry::ArrayData(getVertexAttrib(i),osg::Geometry::BIND_PER_VERTEX));
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
|
||||
ss->addUniform(getMatrixPaletteUniform());
|
||||
ss->addUniform(new osg::Uniform("nbBonesPerVertex", getNumBonesPerVertex()));
|
||||
ss->setAttributeAndModes(program.get());
|
||||
geom.setStateSet(ss.get());
|
||||
_needInit = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct SetupRigGeometry : public osg::NodeVisitor
|
||||
{
|
||||
bool _hardware;
|
||||
SetupRigGeometry( bool hardware = true) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _hardware(hardware) {}
|
||||
|
||||
void apply(osg::Geode& geode)
|
||||
{
|
||||
for (unsigned int i = 0; i < geode.getNumDrawables(); i++)
|
||||
apply(*geode.getDrawable(i));
|
||||
}
|
||||
void apply(osg::Drawable& geom)
|
||||
{
|
||||
if (_hardware) {
|
||||
osgAnimation::RigGeometry* rig = dynamic_cast<osgAnimation::RigGeometry*>(&geom);
|
||||
if (rig)
|
||||
rig->setRigTransformImplementation(new MyRigTransformHardware);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (geom.getName() != std::string("BoundingBox")) // we disable compute of bounding box for all geometry except our bounding box
|
||||
geom.setComputeBoundingBoxCallback(new osg::Drawable::ComputeBoundingBoxCallback);
|
||||
// geom.setInitialBound(new osg::Drawable::ComputeBoundingBoxCallback);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
osg::Group* createCharacterInstance(osg::Group* character, bool hardware)
|
||||
{
|
||||
osg::ref_ptr<osg::Group> c ;
|
||||
if (hardware)
|
||||
c = osg::clone(character, osg::CopyOp::DEEP_COPY_ALL & ~osg::CopyOp::DEEP_COPY_PRIMITIVES & ~osg::CopyOp::DEEP_COPY_ARRAYS);
|
||||
else
|
||||
c = osg::clone(character, osg::CopyOp::DEEP_COPY_ALL);
|
||||
|
||||
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(c->getUpdateCallback());
|
||||
|
||||
osgAnimation::BasicAnimationManager* anim = dynamic_cast<osgAnimation::BasicAnimationManager*>(animationManager);
|
||||
const osgAnimation::AnimationList& list = animationManager->getAnimationList();
|
||||
int v = getRandomValueinRange(list.size());
|
||||
if (list[v]->getName() == std::string("MatIpo_ipo")) {
|
||||
anim->playAnimation(list[v].get());
|
||||
v = (v + 1)%list.size();
|
||||
}
|
||||
|
||||
anim->playAnimation(list[v].get());
|
||||
|
||||
SetupRigGeometry switcher(hardware);
|
||||
c->accept(switcher);
|
||||
|
||||
return c.release();
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
std::cerr << "This example works better with nathan.osg" << std::endl;
|
||||
|
||||
osg::ArgumentParser psr(&argc, argv);
|
||||
|
||||
osgViewer::Viewer viewer(psr);
|
||||
|
||||
bool hardware = true;
|
||||
int maxChar = 10;
|
||||
while (psr.read("--software")) { hardware = false; }
|
||||
while (psr.read("--number", maxChar)) {}
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(psr));
|
||||
if (!root)
|
||||
{
|
||||
std::cout << psr.getApplicationName() <<": No data loaded" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
{
|
||||
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
|
||||
if(!animationManager)
|
||||
{
|
||||
osg::notify(osg::FATAL) << "no AnimationManagerBase found, updateCallback need to animate elements" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Group> scene = new osg::Group;
|
||||
|
||||
// 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(psr.getApplicationUsage()));
|
||||
|
||||
// add the LOD Scale handler
|
||||
viewer.addEventHandler(new osgViewer::LODScaleHandler);
|
||||
|
||||
// add the screen capture handler
|
||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||
|
||||
viewer.setSceneData(scene.get());
|
||||
|
||||
viewer.realize();
|
||||
|
||||
double xChar = maxChar;
|
||||
double yChar = xChar * 9.0/16;
|
||||
for (double i = 0.0; i < xChar; i++) {
|
||||
for (double j = 0.0; j < yChar; j++) {
|
||||
|
||||
osg::ref_ptr<osg::Group> c = createCharacterInstance(root.get(), hardware);
|
||||
osg::MatrixTransform* tr = new osg::MatrixTransform;
|
||||
tr->setMatrix(osg::Matrix::translate( 2.0 * (i - xChar * .5),
|
||||
0.0,
|
||||
2.0 * (j - yChar * .5)));
|
||||
tr->addChild(c.get());
|
||||
scene->addChild(tr);
|
||||
}
|
||||
}
|
||||
std::cout << "created " << xChar * yChar << " instance" << std::endl;
|
||||
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationmakepath.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationmakepath)
|
||||
@@ -1,338 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
* Authors:
|
||||
* Jeremy Moles <jeremy@emperorlinux.com>
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osg/io_utils>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Shape>
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osg/Material>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgAnimation/Sampler>
|
||||
|
||||
class AnimtkUpdateCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
META_Object(osgAnimation, AnimtkUpdateCallback);
|
||||
|
||||
AnimtkUpdateCallback()
|
||||
{
|
||||
_sampler = new osgAnimation::Vec3CubicBezierSampler;
|
||||
_playing = false;
|
||||
_lastUpdate = 0;
|
||||
}
|
||||
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||
osg::Object(val, copyop),
|
||||
osg::NodeCallback(val, copyop),
|
||||
_sampler(val._sampler),
|
||||
_startTime(val._startTime),
|
||||
_currentTime(val._currentTime),
|
||||
_playing(val._playing),
|
||||
_lastUpdate(val._lastUpdate)
|
||||
{
|
||||
}
|
||||
|
||||
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||
nv->getFrameStamp() &&
|
||||
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
|
||||
{
|
||||
|
||||
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||
_currentTime = osg::Timer::instance()->tick();
|
||||
|
||||
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||
{
|
||||
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
|
||||
if (transform) {
|
||||
osg::Vec3 result;
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||
t = fmod(t, duration);
|
||||
t += _sampler->getStartTime();
|
||||
_sampler->getValueAt(t, result);
|
||||
transform->setMatrix(osg::Matrix::translate(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
// note, callback is responsible for scenegraph traversal so
|
||||
// they must call traverse(node,nv) to ensure that the
|
||||
// scene graph subtree (and associated callbacks) are traversed.
|
||||
traverse(node,nv);
|
||||
}
|
||||
|
||||
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||
void stop() { _currentTime = _startTime; _playing = false;}
|
||||
|
||||
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
|
||||
osg::Timer_t _startTime;
|
||||
osg::Timer_t _currentTime;
|
||||
bool _playing;
|
||||
int _lastUpdate;
|
||||
};
|
||||
|
||||
|
||||
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
|
||||
{
|
||||
public:
|
||||
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
|
||||
|
||||
AnimtkStateSetUpdateCallback()
|
||||
{
|
||||
_sampler = new osgAnimation::Vec4LinearSampler;
|
||||
_playing = false;
|
||||
_lastUpdate = 0;
|
||||
}
|
||||
|
||||
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||
osg::Object(val, copyop),
|
||||
osg::StateSet::Callback(val, copyop),
|
||||
_sampler(val._sampler),
|
||||
_startTime(val._startTime),
|
||||
_currentTime(val._currentTime),
|
||||
_playing(val._playing),
|
||||
_lastUpdate(val._lastUpdate)
|
||||
{
|
||||
}
|
||||
|
||||
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (state &&
|
||||
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||
nv->getFrameStamp() &&
|
||||
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
|
||||
|
||||
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||
_currentTime = osg::Timer::instance()->tick();
|
||||
|
||||
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||
{
|
||||
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
if (material)
|
||||
{
|
||||
osg::Vec4 result;
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||
t = fmod(t, duration);
|
||||
t += _sampler->getStartTime();
|
||||
_sampler->getValueAt(t, result);
|
||||
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||
void stop() { _currentTime = _startTime; _playing = false;}
|
||||
|
||||
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
|
||||
osg::Timer_t _startTime;
|
||||
osg::Timer_t _currentTime;
|
||||
bool _playing;
|
||||
int _lastUpdate;
|
||||
};
|
||||
|
||||
// This won't really give good results in any situation, but it does demonstrate
|
||||
// on possible "fast" usage...
|
||||
class MakePathTimeCallback: public AnimtkUpdateCallback
|
||||
{
|
||||
osg::ref_ptr<osg::Geode> _geode;
|
||||
float _lastAdd;
|
||||
float _addSeconds;
|
||||
|
||||
public:
|
||||
MakePathTimeCallback(osg::Geode* geode):
|
||||
_geode(geode),
|
||||
_lastAdd(0.0f),
|
||||
_addSeconds(0.08f) {
|
||||
}
|
||||
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
|
||||
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
|
||||
{
|
||||
osg::Vec3 pos;
|
||||
|
||||
_sampler->getValueAt(t, pos);
|
||||
|
||||
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.5f)));
|
||||
_geode->dirtyBound();
|
||||
|
||||
_lastAdd += _addSeconds;
|
||||
}
|
||||
|
||||
AnimtkUpdateCallback::operator()(node, nv);
|
||||
}
|
||||
};
|
||||
|
||||
// This will give great results if you DO NOT have VSYNC enabled and can generate
|
||||
// decent FPS.
|
||||
class MakePathDistanceCallback: public AnimtkUpdateCallback
|
||||
{
|
||||
osg::ref_ptr<osg::Geode> _geode;
|
||||
osg::Vec3 _lastAdd;
|
||||
float _threshold;
|
||||
unsigned int _count;
|
||||
|
||||
public:
|
||||
MakePathDistanceCallback(osg::Geode* geode):
|
||||
_geode(geode),
|
||||
_threshold(0.5f),
|
||||
_count(0) {}
|
||||
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
static bool countReported = false;
|
||||
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
|
||||
osg::Vec3 pos;
|
||||
|
||||
_sampler->getValueAt(t, pos);
|
||||
|
||||
osg::Vec3 distance = _lastAdd - pos;
|
||||
|
||||
if(t <= 8.0f && distance.length() >= _threshold)
|
||||
{
|
||||
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
|
||||
_lastAdd = pos;
|
||||
_count++;
|
||||
}
|
||||
else if(t > 8.0f)
|
||||
{
|
||||
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
|
||||
countReported = true;
|
||||
}
|
||||
|
||||
AnimtkUpdateCallback::operator()(node, nv);
|
||||
}
|
||||
};
|
||||
|
||||
osg::StateSet* setupStateSet()
|
||||
{
|
||||
osg::StateSet* st = new osg::StateSet();
|
||||
|
||||
st->setAttributeAndModes(new osg::Material(), true);
|
||||
st->setMode(GL_BLEND, true);
|
||||
|
||||
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
|
||||
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.,1,0,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0,1,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,1,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(0,1,0,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
|
||||
callback->start();
|
||||
st->setUpdateCallback(callback);
|
||||
|
||||
return st;
|
||||
}
|
||||
|
||||
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
|
||||
{
|
||||
osg::Vec3 v[5];
|
||||
|
||||
v[0] = osg::Vec3( 0, 0, 0);
|
||||
v[1] = osg::Vec3(20, 40, 60);
|
||||
v[2] = osg::Vec3(40, 60, 20);
|
||||
v[3] = osg::Vec3(60, 20, 40);
|
||||
v[4] = osg::Vec3( 0, 0, 0);
|
||||
|
||||
osg::MatrixTransform* node = new osg::MatrixTransform();
|
||||
AnimtkUpdateCallback* callback = new MakePathDistanceCallback(staticGeode);
|
||||
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
|
||||
v[0],
|
||||
v[0] + (v[0] - v[3]),
|
||||
v[1] - (v[1] - v[0])
|
||||
)));
|
||||
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
|
||||
v[1],
|
||||
v[1] + (v[1] - v[0]),
|
||||
v[2] - (v[2] - v[1])
|
||||
)));
|
||||
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
|
||||
v[2],
|
||||
v[2] + (v[2] - v[1]),
|
||||
v[3] - (v[3] - v[2])
|
||||
)));
|
||||
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
|
||||
v[3],
|
||||
v[3] + (v[3] - v[2]),
|
||||
v[4] - (v[4] - v[3])
|
||||
)));
|
||||
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
|
||||
v[4],
|
||||
v[4] + (v[4] - v[3]),
|
||||
v[0] - (v[0] - v[4])
|
||||
)));
|
||||
|
||||
callback->start();
|
||||
node->setUpdateCallback(callback);
|
||||
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
|
||||
geode->setStateSet(setupStateSet());
|
||||
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
|
||||
|
||||
node->addChild(geode);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
|
||||
|
||||
viewer.setCameraManipulator(tbm);
|
||||
|
||||
viewer.addEventHandler(new osgViewer::StatsHandler());
|
||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||
|
||||
osg::Group* root = new osg::Group();
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
|
||||
geode->setStateSet(setupStateSet());
|
||||
|
||||
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,20), 50));
|
||||
root->addChild(setupAnimtkNode(geode));
|
||||
root->addChild(geode);
|
||||
|
||||
viewer.setSceneData(root);
|
||||
|
||||
// tbm->setDistance(150);
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationnode.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationnode)
|
||||
@@ -1,274 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Shape>
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/Material>
|
||||
#include <osgAnimation/Sampler>
|
||||
|
||||
class AnimtkUpdateCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
META_Object(osgAnimation, AnimtkUpdateCallback);
|
||||
|
||||
AnimtkUpdateCallback()
|
||||
{
|
||||
_sampler = new osgAnimation::Vec3CubicBezierSampler;
|
||||
_playing = false;
|
||||
_lastUpdate = 0;
|
||||
}
|
||||
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||
osg::Object(val, copyop),
|
||||
osg::NodeCallback(val, copyop),
|
||||
_sampler(val._sampler),
|
||||
_startTime(val._startTime),
|
||||
_currentTime(val._currentTime),
|
||||
_playing(val._playing),
|
||||
_lastUpdate(val._lastUpdate)
|
||||
{
|
||||
}
|
||||
|
||||
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||
nv->getFrameStamp() &&
|
||||
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
|
||||
|
||||
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||
_currentTime = osg::Timer::instance()->tick();
|
||||
|
||||
if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) {
|
||||
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
|
||||
if (transform) {
|
||||
osg::Vec3 result;
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||
t = fmod(t, duration);
|
||||
t += _sampler->getStartTime();
|
||||
_sampler->getValueAt(t, result);
|
||||
transform->setMatrix(osg::Matrix::translate(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
// note, callback is responsible for scenegraph traversal so
|
||||
// they must call traverse(node,nv) to ensure that the
|
||||
// scene graph subtree (and associated callbacks) are traversed.
|
||||
traverse(node,nv);
|
||||
}
|
||||
|
||||
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||
void stop() { _currentTime = _startTime; _playing = false;}
|
||||
|
||||
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
|
||||
osg::Timer_t _startTime;
|
||||
osg::Timer_t _currentTime;
|
||||
bool _playing;
|
||||
int _lastUpdate;
|
||||
};
|
||||
|
||||
|
||||
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
|
||||
{
|
||||
public:
|
||||
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
|
||||
|
||||
AnimtkStateSetUpdateCallback()
|
||||
{
|
||||
_sampler = new osgAnimation::Vec4LinearSampler;
|
||||
_playing = false;
|
||||
_lastUpdate = 0;
|
||||
}
|
||||
|
||||
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||
osg::Object(val, copyop),
|
||||
osg::StateSet::Callback(val, copyop),
|
||||
_sampler(val._sampler),
|
||||
_startTime(val._startTime),
|
||||
_currentTime(val._currentTime),
|
||||
_playing(val._playing),
|
||||
_lastUpdate(val._lastUpdate)
|
||||
{
|
||||
}
|
||||
|
||||
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (state &&
|
||||
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||
nv->getFrameStamp() &&
|
||||
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
|
||||
{
|
||||
|
||||
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||
_currentTime = osg::Timer::instance()->tick();
|
||||
|
||||
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||
{
|
||||
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
if (material)
|
||||
{
|
||||
osg::Vec4 result;
|
||||
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||
t = fmod(t, duration);
|
||||
t += _sampler->getStartTime();
|
||||
_sampler->getValueAt(t, result);
|
||||
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||
void stop() { _currentTime = _startTime; _playing = false;}
|
||||
|
||||
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
|
||||
osg::Timer_t _startTime;
|
||||
osg::Timer_t _currentTime;
|
||||
bool _playing;
|
||||
int _lastUpdate;
|
||||
};
|
||||
|
||||
|
||||
osg::Geode* createAxis()
|
||||
{
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
|
||||
geometry->setVertexArray (vertices.get());
|
||||
|
||||
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
geometry->setColorArray (colors.get());
|
||||
|
||||
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||
|
||||
geode->addDrawable( geometry.get() );
|
||||
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||
return geode;
|
||||
}
|
||||
|
||||
osg::StateSet* setupStateSet()
|
||||
{
|
||||
osg::StateSet* st = new osg::StateSet;
|
||||
st->setAttributeAndModes(new osg::Material, true);
|
||||
st->setMode(GL_BLEND, true);
|
||||
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback;
|
||||
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(0,0,0,0)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.5,0,0,0.5)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0.5,0,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,0.5,1)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(1,1,1,0.5)));
|
||||
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(0,0,0,0)));
|
||||
callback->start();
|
||||
st->setUpdateCallback(callback);
|
||||
return st;
|
||||
}
|
||||
|
||||
osg::Node* setupCube()
|
||||
{
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),2)));
|
||||
geode->setStateSet(setupStateSet());
|
||||
return geode;
|
||||
}
|
||||
|
||||
osg::MatrixTransform* setupAnimtkNode()
|
||||
{
|
||||
osg::Vec3 v[5];
|
||||
v[0] = osg::Vec3(0,0,0);
|
||||
v[1] = osg::Vec3(10,-50,0);
|
||||
v[2] = osg::Vec3(30,-10,20);
|
||||
v[3] = osg::Vec3(-10,20,-20);
|
||||
v[4] = osg::Vec3(0,0,0);
|
||||
osg::MatrixTransform* node = new osg::MatrixTransform;
|
||||
AnimtkUpdateCallback* callback = new AnimtkUpdateCallback;
|
||||
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
|
||||
v[0], // pos
|
||||
v[0] + (v[0] - v[3]), // p1
|
||||
v[1] - (v[1] - v[0]) // p2
|
||||
)));
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
|
||||
v[1], // pos
|
||||
v[1] + (v[1] - v[0]),
|
||||
v[2] - (v[2] - v[1])
|
||||
)));
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
|
||||
v[2], // pos
|
||||
v[2] + (v[2] - v[1]),
|
||||
v[3] - (v[3] - v[2])
|
||||
)));
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
|
||||
v[3], // pos
|
||||
v[3] + (v[3] - v[2]),
|
||||
v[4] - (v[4] - v[3])
|
||||
)));
|
||||
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
|
||||
v[4], // pos
|
||||
v[4] + (v[4] - v[3]),
|
||||
v[0] - (v[0] - v[4])
|
||||
)));
|
||||
|
||||
callback->start();
|
||||
node->setUpdateCallback(callback);
|
||||
node->addChild(setupCube());
|
||||
return node;
|
||||
}
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
osgGA::TrackballManipulator* manipulator = new osgGA::TrackballManipulator();
|
||||
viewer.setCameraManipulator(manipulator);
|
||||
|
||||
osg::Group* root = new osg::Group;
|
||||
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,10), 30));
|
||||
root->addChild(createAxis());
|
||||
|
||||
osg::MatrixTransform* node = setupAnimtkNode();
|
||||
node->addChild(createAxis());
|
||||
root->addChild(node);
|
||||
|
||||
viewer.setSceneData( root );
|
||||
viewer.realize();
|
||||
|
||||
while (!viewer.done())
|
||||
{
|
||||
viewer.frame();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationskinning.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationskinning)
|
||||
@@ -1,274 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/Geode>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgDB/WriteFile>
|
||||
#include <osgUtil/SmoothingVisitor>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgAnimation/Bone>
|
||||
#include <osgAnimation/Skeleton>
|
||||
#include <osgAnimation/RigGeometry>
|
||||
#include <osgAnimation/BasicAnimationManager>
|
||||
#include <osgAnimation/UpdateMatrixTransform>
|
||||
#include <osgAnimation/UpdateBone>
|
||||
#include <osgAnimation/StackedTransform>
|
||||
#include <osgAnimation/StackedTranslateElement>
|
||||
#include <osgAnimation/StackedRotateAxisElement>
|
||||
|
||||
osg::Geode* createAxis()
|
||||
{
|
||||
osg::Geode* geode (new osg::Geode());
|
||||
osg::Geometry* geometry (new osg::Geometry());
|
||||
|
||||
osg::Vec3Array* vertices (new osg::Vec3Array());
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 1.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 1.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 1.0));
|
||||
geometry->setVertexArray (vertices);
|
||||
|
||||
osg::Vec4Array* colors (new osg::Vec4Array());
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
geometry->setColorArray (colors);
|
||||
|
||||
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||
|
||||
geode->addDrawable( geometry );
|
||||
return geode;
|
||||
}
|
||||
|
||||
osgAnimation::RigGeometry* createTesselatedBox(int nsplit, float size)
|
||||
{
|
||||
osgAnimation::RigGeometry* riggeometry = new osgAnimation::RigGeometry;
|
||||
|
||||
osg::Geometry* geometry = new osg::Geometry;
|
||||
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||
osg::ref_ptr<osg::Vec3Array> colors (new osg::Vec3Array());
|
||||
geometry->setVertexArray (vertices.get());
|
||||
geometry->setColorArray (colors.get());
|
||||
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||
|
||||
float step = size / nsplit;
|
||||
float s = 0.5/4.0;
|
||||
for (int i = 0; i < nsplit; i++)
|
||||
{
|
||||
float x = -1 + i * step;
|
||||
std::cout << x << std::endl;
|
||||
vertices->push_back (osg::Vec3 ( x, s, s));
|
||||
vertices->push_back (osg::Vec3 ( x, -s, s));
|
||||
vertices->push_back (osg::Vec3 ( x, -s, -s));
|
||||
vertices->push_back (osg::Vec3 ( x, s, -s));
|
||||
osg::Vec3 c (0,0,0);
|
||||
c[i%3] = 1;
|
||||
colors->push_back (c);
|
||||
colors->push_back (c);
|
||||
colors->push_back (c);
|
||||
colors->push_back (c);
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::UIntArray> array = new osg::UIntArray;
|
||||
for (int i = 0; i < nsplit - 1; i++)
|
||||
{
|
||||
int base = i * 4;
|
||||
array->push_back(base);
|
||||
array->push_back(base+1);
|
||||
array->push_back(base+4);
|
||||
array->push_back(base+1);
|
||||
array->push_back(base+5);
|
||||
array->push_back(base+4);
|
||||
|
||||
array->push_back(base+3);
|
||||
array->push_back(base);
|
||||
array->push_back(base+4);
|
||||
array->push_back(base+7);
|
||||
array->push_back(base+3);
|
||||
array->push_back(base+4);
|
||||
|
||||
array->push_back(base+5);
|
||||
array->push_back(base+1);
|
||||
array->push_back(base+2);
|
||||
array->push_back(base+2);
|
||||
array->push_back(base+6);
|
||||
array->push_back(base+5);
|
||||
|
||||
array->push_back(base+2);
|
||||
array->push_back(base+3);
|
||||
array->push_back(base+7);
|
||||
array->push_back(base+6);
|
||||
array->push_back(base+2);
|
||||
array->push_back(base+7);
|
||||
}
|
||||
|
||||
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, array->size(), &array->front()));
|
||||
geometry->setUseDisplayList( false );
|
||||
riggeometry->setSourceGeometry(geometry);
|
||||
return riggeometry;
|
||||
}
|
||||
|
||||
|
||||
void initVertexMap(osgAnimation::Bone* b0,
|
||||
osgAnimation::Bone* b1,
|
||||
osgAnimation::Bone* b2,
|
||||
osgAnimation::RigGeometry* geom,
|
||||
osg::Vec3Array* array)
|
||||
{
|
||||
osgAnimation::VertexInfluenceSet vertexesInfluences;
|
||||
osgAnimation::VertexInfluenceMap* vim = new osgAnimation::VertexInfluenceMap;
|
||||
|
||||
(*vim)[b0->getName()].setName(b0->getName());
|
||||
(*vim)[b1->getName()].setName(b1->getName());
|
||||
(*vim)[b2->getName()].setName(b2->getName());
|
||||
|
||||
for (int i = 0; i < (int)array->size(); i++)
|
||||
{
|
||||
float val = (*array)[i][0];
|
||||
std::cout << val << std::endl;
|
||||
if (val >= -1 && val <= 0)
|
||||
(*vim)[b0->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||
else if ( val > 0 && val <= 1)
|
||||
(*vim)[b1->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||
else if ( val > 1)
|
||||
(*vim)[b2->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||
}
|
||||
|
||||
geom->setInfluenceMap(vim);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
|
||||
|
||||
osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton;
|
||||
skelroot->setDefaultUpdateCallback();
|
||||
osg::ref_ptr<osgAnimation::Bone> root = new osgAnimation::Bone;
|
||||
root->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(-1,0,0)));
|
||||
root->setName("root");
|
||||
osgAnimation::UpdateBone* pRootUpdate = new osgAnimation::UpdateBone("root");
|
||||
pRootUpdate->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate",osg::Vec3(-1,0,0)));
|
||||
root->setUpdateCallback(pRootUpdate);
|
||||
|
||||
osg::ref_ptr<osgAnimation::Bone> right0 = new osgAnimation::Bone;
|
||||
right0->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(0,0,0)));
|
||||
right0->setName("right0");
|
||||
osgAnimation::UpdateBone* pRight0Update = new osgAnimation::UpdateBone("right0");
|
||||
pRight0Update->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate", osg::Vec3(1,0,0)));
|
||||
pRight0Update->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("rotate", osg::Vec3(0,0,1), 0));
|
||||
right0->setUpdateCallback(pRight0Update);
|
||||
|
||||
osg::ref_ptr<osgAnimation::Bone> right1 = new osgAnimation::Bone;
|
||||
right1->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(1,0,0)));
|
||||
right1->setName("right1");
|
||||
osgAnimation::UpdateBone* pRight1Update = new osgAnimation::UpdateBone("right1");
|
||||
pRight1Update->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate", osg::Vec3(1,0,0)));
|
||||
pRight1Update->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("rotate", osg::Vec3(0,0,1), 0));
|
||||
right1->setUpdateCallback(pRight1Update);
|
||||
|
||||
root->addChild(right0.get());
|
||||
right0->addChild(right1.get());
|
||||
skelroot->addChild(root.get());
|
||||
|
||||
osg::Group* scene = new osg::Group;
|
||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> manager = new osgAnimation::BasicAnimationManager;
|
||||
scene->setUpdateCallback(manager.get());
|
||||
|
||||
osgAnimation::Animation* anim = new osgAnimation::Animation;
|
||||
{
|
||||
osgAnimation::FloatKeyframeContainer* keys0 = new osgAnimation::FloatKeyframeContainer;
|
||||
keys0->push_back(osgAnimation::FloatKeyframe(0,0));
|
||||
keys0->push_back(osgAnimation::FloatKeyframe(3,osg::PI_2));
|
||||
keys0->push_back(osgAnimation::FloatKeyframe(6,osg::PI_2));
|
||||
osgAnimation::FloatLinearSampler* sampler = new osgAnimation::FloatLinearSampler;
|
||||
sampler->setKeyframeContainer(keys0);
|
||||
osgAnimation::FloatLinearChannel* channel = new osgAnimation::FloatLinearChannel(sampler);
|
||||
channel->setName("rotate");
|
||||
channel->setTargetName("right0");
|
||||
anim->addChannel(channel);
|
||||
}
|
||||
|
||||
{
|
||||
osgAnimation::FloatKeyframeContainer* keys1 = new osgAnimation::FloatKeyframeContainer;
|
||||
keys1->push_back(osgAnimation::FloatKeyframe(0,0));
|
||||
keys1->push_back(osgAnimation::FloatKeyframe(3,0));
|
||||
keys1->push_back(osgAnimation::FloatKeyframe(6,osg::PI_2));
|
||||
osgAnimation::FloatLinearSampler* sampler = new osgAnimation::FloatLinearSampler;
|
||||
sampler->setKeyframeContainer(keys1);
|
||||
osgAnimation::FloatLinearChannel* channel = new osgAnimation::FloatLinearChannel(sampler);
|
||||
channel->setName("rotate");
|
||||
channel->setTargetName("right1");
|
||||
anim->addChannel(channel);
|
||||
}
|
||||
manager->registerAnimation(anim);
|
||||
manager->buildTargetReference();
|
||||
|
||||
// let's start !
|
||||
manager->playAnimation(anim);
|
||||
|
||||
// we will use local data from the skeleton
|
||||
osg::MatrixTransform* rootTransform = new osg::MatrixTransform;
|
||||
rootTransform->setMatrix(osg::Matrix::rotate(osg::PI_2,osg::Vec3(1,0,0)));
|
||||
right0->addChild(createAxis());
|
||||
right0->setDataVariance(osg::Object::DYNAMIC);
|
||||
right1->addChild(createAxis());
|
||||
right1->setDataVariance(osg::Object::DYNAMIC);
|
||||
osg::MatrixTransform* trueroot = new osg::MatrixTransform;
|
||||
trueroot->setMatrix(osg::Matrix(root->getMatrixInBoneSpace().ptr()));
|
||||
trueroot->addChild(createAxis());
|
||||
trueroot->addChild(skelroot.get());
|
||||
trueroot->setDataVariance(osg::Object::DYNAMIC);
|
||||
rootTransform->addChild(trueroot);
|
||||
scene->addChild(rootTransform);
|
||||
|
||||
osgAnimation::RigGeometry* geom = createTesselatedBox(4, 4.0);
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
geode->addDrawable(geom);
|
||||
skelroot->addChild(geode);
|
||||
osg::ref_ptr<osg::Vec3Array> src = dynamic_cast<osg::Vec3Array*>(geom->getSourceGeometry()->getVertexArray());
|
||||
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||
geom->setDataVariance(osg::Object::DYNAMIC);
|
||||
|
||||
initVertexMap(root.get(), right0.get(), right1.get(), geom, src.get());
|
||||
|
||||
// let's run !
|
||||
viewer.setSceneData( scene );
|
||||
viewer.realize();
|
||||
|
||||
while (!viewer.done())
|
||||
{
|
||||
viewer.frame();
|
||||
}
|
||||
|
||||
osgDB::writeNodeFile(*scene, "skinning.osg");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationsolid.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationsolid)
|
||||
@@ -1,124 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Shape>
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osg/MatrixTransform>
|
||||
|
||||
#include <osgAnimation/BasicAnimationManager>
|
||||
#include <osgAnimation/Channel>
|
||||
#include <osgAnimation/UpdateMatrixTransform>
|
||||
#include <osgAnimation/StackedTranslateElement>
|
||||
|
||||
using namespace osgAnimation;
|
||||
|
||||
osg::ref_ptr<osg::Geode> createAxis()
|
||||
{
|
||||
osg::ref_ptr<osg::Geode> geode (new osg::Geode());
|
||||
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
|
||||
geometry->setVertexArray (vertices.get());
|
||||
|
||||
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||
geometry->setColorArray (colors.get());
|
||||
|
||||
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||
|
||||
geode->addDrawable( geometry.get() );
|
||||
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||
return geode;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
|
||||
|
||||
osg::Group* root = new osg::Group;
|
||||
|
||||
osg::ref_ptr<osg::Geode> axe = createAxis();
|
||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
||||
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),0.5)));
|
||||
|
||||
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform();
|
||||
trans->setName("AnimatedNode");
|
||||
trans->setDataVariance(osg::Object::DYNAMIC);
|
||||
osgAnimation::UpdateMatrixTransform* updatecb = new osgAnimation::UpdateMatrixTransform("AnimatedCallback");
|
||||
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("position"));
|
||||
trans->setUpdateCallback(updatecb);
|
||||
trans->setMatrix(osg::Matrix::identity());
|
||||
trans->addChild (geode.get());
|
||||
|
||||
root->addChild (axe.get());
|
||||
root->addChild (trans.get());
|
||||
|
||||
// Define a scheduler for our animations
|
||||
osg::Group* grp = new osg::Group;
|
||||
osgAnimation::BasicAnimationManager* mng = new osgAnimation::BasicAnimationManager();
|
||||
grp->setUpdateCallback(mng);
|
||||
|
||||
grp->addChild(root);
|
||||
|
||||
// And we finaly define our channel
|
||||
osgAnimation::Vec3LinearChannel* channelAnimation1 = new osgAnimation::Vec3LinearChannel;
|
||||
channelAnimation1->setTargetName("AnimatedCallback");
|
||||
channelAnimation1->setName("position");
|
||||
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
|
||||
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(2, osg::Vec3(1,1,0)));
|
||||
osgAnimation::Animation* anim1 = new osgAnimation::Animation;
|
||||
anim1->addChannel(channelAnimation1);
|
||||
anim1->setPlaymode(osgAnimation::Animation::PPONG);
|
||||
|
||||
|
||||
osgAnimation::Vec3LinearChannel* channelAnimation2 = new osgAnimation::Vec3LinearChannel;
|
||||
channelAnimation2->setTargetName("AnimatedCallback");
|
||||
channelAnimation2->setName("euler");
|
||||
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
|
||||
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(1.5, osg::Vec3(2*osg::PI,0,0)));
|
||||
osgAnimation::Animation* anim2 = new osgAnimation::Animation;
|
||||
anim2->addChannel(channelAnimation2);
|
||||
anim2->setPlaymode(osgAnimation::Animation::LOOP);
|
||||
|
||||
|
||||
// We register all animation inside the scheduler
|
||||
mng->registerAnimation(anim1);
|
||||
mng->registerAnimation(anim2);
|
||||
|
||||
mng->playAnimation(anim1);
|
||||
mng->playAnimation(anim2);
|
||||
|
||||
viewer.setSceneData( grp );
|
||||
return viewer.run();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(TARGET_SRC osganimationtimeline.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||
SETUP_EXAMPLE(osganimationtimeline)
|
||||
@@ -1,222 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <osgDB/ReadFile>
|
||||
#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 <osgAnimation/Bone>
|
||||
#include <osgAnimation/Skeleton>
|
||||
#include <osgAnimation/RigGeometry>
|
||||
#include <osgAnimation/Timeline>
|
||||
#include <osgAnimation/AnimationManagerBase>
|
||||
#include <osgAnimation/TimelineAnimationManager>
|
||||
|
||||
#include <osgAnimation/ActionStripAnimation>
|
||||
#include <osgAnimation/ActionBlendIn>
|
||||
#include <osgAnimation/ActionBlendOut>
|
||||
#include <osgAnimation/ActionAnimation>
|
||||
|
||||
|
||||
struct NoseBegin : public osgAnimation::Action::Callback
|
||||
{
|
||||
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
|
||||
{
|
||||
std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl;
|
||||
std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
struct NoseEnd : public osgAnimation::Action::Callback
|
||||
{
|
||||
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
|
||||
{
|
||||
std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl;
|
||||
std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
struct ExampleTimelineUsage : public osgGA::GUIEventHandler
|
||||
{
|
||||
osg::ref_ptr<osgAnimation::ActionStripAnimation> _mainLoop;
|
||||
osg::ref_ptr<osgAnimation::ActionStripAnimation> _scratchHead;
|
||||
osg::ref_ptr<osgAnimation::ActionStripAnimation> _scratchNose;
|
||||
osg::ref_ptr<osgAnimation::TimelineAnimationManager> _manager;
|
||||
|
||||
bool _releaseKey;
|
||||
|
||||
ExampleTimelineUsage(osgAnimation::TimelineAnimationManager* manager)
|
||||
{
|
||||
_releaseKey = false;
|
||||
_manager = manager;
|
||||
|
||||
const osgAnimation::AnimationList& list = _manager->getAnimationList();
|
||||
osgAnimation::AnimationMap map;
|
||||
for (osgAnimation::AnimationList::const_iterator it = list.begin(); it != list.end(); it++)
|
||||
map[(*it)->getName()] = *it;
|
||||
|
||||
_mainLoop = new osgAnimation::ActionStripAnimation(map["Idle_Main"].get(),0.0,0.0);
|
||||
_mainLoop->setLoop(0); // means forever
|
||||
|
||||
_scratchHead = new osgAnimation::ActionStripAnimation(map["Idle_Head_Scratch.02"].get(),0.2,0.3);
|
||||
_scratchHead->setLoop(1); // one time
|
||||
|
||||
map["Idle_Nose_Scratch.01"]->setDuration(10.0); // set this animation duration to 10 seconds
|
||||
_scratchNose = new osgAnimation::ActionStripAnimation(map["Idle_Nose_Scratch.01"].get(),0.2,0.3);
|
||||
_scratchNose->setLoop(1); // one time
|
||||
|
||||
// add the main loop at priority 0 at time 0.
|
||||
|
||||
osgAnimation::Timeline* tml = _manager->getTimeline();
|
||||
tml->play();
|
||||
tml->addActionAt(0.0, _mainLoop.get(), 0);
|
||||
|
||||
|
||||
// add a scratch head priority 1 at 3.0 second.
|
||||
tml->addActionAt(5.0, _scratchHead.get(), 1);
|
||||
|
||||
// populate time with scratch head
|
||||
for (int i = 1; i < 20; i++)
|
||||
{
|
||||
// we add a scratch head priority 1 each 10 second
|
||||
// note:
|
||||
// it's possible to add the same instance more then once on the timeline
|
||||
// the only things you need to take care is if you remove it. It will remove
|
||||
// all instance that exist on the timeline. If you need to differtiate
|
||||
// it's better to create a new instance
|
||||
tml->addActionAt(5.0 + 10.0 * i, _scratchHead.get(), 1);
|
||||
}
|
||||
|
||||
// we will add the scratch nose action only when the player hit a key
|
||||
// in the operator()
|
||||
|
||||
// now we will add callback at end and begin of animation of Idle_Nose_Scratch.02
|
||||
_scratchNose->setCallback(0.0, new NoseBegin);
|
||||
_scratchNose->setCallback(_scratchNose->getNumFrames()-1, new NoseEnd);
|
||||
}
|
||||
|
||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||
{
|
||||
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||
{
|
||||
_releaseKey = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||
{
|
||||
if (_releaseKey) // we hit a key and release it execute an action
|
||||
{
|
||||
osgAnimation::Timeline* tml = _manager->getTimeline();
|
||||
// dont play if already playing
|
||||
if (!tml->isActive(_scratchNose.get()))
|
||||
{
|
||||
// add this animation on top of two other
|
||||
// we add one to evaluate the animation at the next frame, else we
|
||||
// will miss the current frame
|
||||
tml->addActionAt(tml->getCurrentFrame() + 1, _scratchNose.get(), 2);
|
||||
}
|
||||
_releaseKey = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||
if (ev && ev->getActionAdapter() && !ev->getEvents().empty())
|
||||
{
|
||||
for(osgGA::EventQueue::Events::iterator itr = ev->getEvents().begin();
|
||||
itr != ev->getEvents().end();
|
||||
++itr)
|
||||
{
|
||||
handleWithCheckAgainstIgnoreHandledEventsMask(*(*itr), *(ev->getActionAdapter()), node, nv);
|
||||
}
|
||||
}
|
||||
}
|
||||
traverse(node, nv);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
std::cerr << "This example works only with nathan.osg" << std::endl;
|
||||
|
||||
osg::ArgumentParser psr(&argc, argv);
|
||||
|
||||
osgViewer::Viewer viewer(psr);
|
||||
|
||||
std::string file = "nathan.osg";
|
||||
if(argc >= 2)
|
||||
file = psr[1];
|
||||
|
||||
// replace the manager
|
||||
osg::Group* root = dynamic_cast<osg::Group*>(osgDB::readNodeFile(file));
|
||||
if (!root) {
|
||||
osg::notify(osg::FATAL) << "can't read file " << file << std::endl;
|
||||
return 1;
|
||||
}
|
||||
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
|
||||
if(!animationManager)
|
||||
{
|
||||
osg::notify(osg::FATAL) << "Did not find AnimationManagerBase updateCallback needed to animate elements" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
osg::ref_ptr<osgAnimation::TimelineAnimationManager> tl = new osgAnimation::TimelineAnimationManager(*animationManager);
|
||||
root->setUpdateCallback(tl.get());
|
||||
|
||||
ExampleTimelineUsage* callback = new ExampleTimelineUsage(tl.get());
|
||||
root->setEventCallback(callback);
|
||||
root->getUpdateCallback()->addNestedCallback(callback);
|
||||
|
||||
|
||||
|
||||
// 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(psr.getApplicationUsage()));
|
||||
|
||||
// add the LOD Scale handler
|
||||
viewer.addEventHandler(new osgViewer::LODScaleHandler);
|
||||
|
||||
// add the screen capture handler
|
||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||
|
||||
viewer.setSceneData(root);
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
* Authors:
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
* jeremy Moles <jeremy@emperorlinux.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANIMTKVIEWER_H
|
||||
#define ANIMTKVIEWER_H
|
||||
|
||||
#include <osg/Node>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgAnimation/BasicAnimationManager>
|
||||
|
||||
class AnimtkViewerModelController
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::string> AnimationMapVector;
|
||||
|
||||
static AnimtkViewerModelController& instance()
|
||||
{
|
||||
static AnimtkViewerModelController avmc;
|
||||
return avmc;
|
||||
}
|
||||
|
||||
static bool setModel(osgAnimation::BasicAnimationManager* model)
|
||||
{
|
||||
AnimtkViewerModelController& self = instance();
|
||||
self._model = model;
|
||||
for (osgAnimation::AnimationList::const_iterator it = self._model->getAnimationList().begin(); it != self._model->getAnimationList().end(); it++)
|
||||
self._map[(*it)->getName()] = *it;
|
||||
|
||||
for(osgAnimation::AnimationMap::iterator it = self._map.begin(); it != self._map.end(); it++)
|
||||
self._amv.push_back(it->first);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool list()
|
||||
{
|
||||
std::cout << "Animation List:" << std::endl;
|
||||
for(osgAnimation::AnimationMap::iterator it = _map.begin(); it != _map.end(); it++)
|
||||
std::cout << it->first << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool play()
|
||||
{
|
||||
if(_focus < _amv.size())
|
||||
{
|
||||
std::cout << "Play " << _amv[_focus] << std::endl;
|
||||
_model->playAnimation(_map[_amv[_focus]].get());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool stop()
|
||||
{
|
||||
if(_focus < _amv.size())
|
||||
{
|
||||
std::cout << "Stop " << _amv[_focus] << std::endl;
|
||||
_model->stopAnimation(_map[_amv[_focus]].get());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool next()
|
||||
{
|
||||
_focus = (_focus + 1) % _map.size();
|
||||
std::cout << "Current now is " << _amv[_focus] << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool previous()
|
||||
{
|
||||
_focus = (_map.size() + _focus - 1) % _map.size();
|
||||
std::cout << "Current now is " << _amv[_focus] << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool playByName(const std::string& name)
|
||||
{
|
||||
for(unsigned int i = 0; i < _amv.size(); i++) if(_amv[i] == name) _focus = i;
|
||||
_model->playAnimation(_map[name].get());
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string& getCurrentAnimationName() const
|
||||
{
|
||||
return _amv[_focus];
|
||||
}
|
||||
|
||||
const AnimationMapVector& getAnimationMap() const
|
||||
{
|
||||
return _amv;
|
||||
}
|
||||
|
||||
private:
|
||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> _model;
|
||||
osgAnimation::AnimationMap _map;
|
||||
AnimationMapVector _amv;
|
||||
unsigned int _focus;
|
||||
|
||||
AnimtkViewerModelController():
|
||||
_model(0),
|
||||
_focus(0) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,174 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
* Authors:
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
* jeremy Moles <jeremy@emperorlinux.com>
|
||||
*/
|
||||
|
||||
#include "AnimtkViewerKeyHandler"
|
||||
#include "AnimtkViewerGUI"
|
||||
|
||||
#include <iostream>
|
||||
#include <osg/io_utils>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/Geode>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
#include <osgWidget/ViewerEventHandlers>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgGA/StateSetManipulator>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgAnimation/AnimationManagerBase>
|
||||
#include <osgAnimation/Bone>
|
||||
|
||||
const int WIDTH = 1440;
|
||||
const int HEIGHT = 900;
|
||||
|
||||
|
||||
osg::Geode* createAxis()
|
||||
{
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
osg::Geometry* geometry = new osg::Geometry();
|
||||
osg::Vec3Array* vertices = new osg::Vec3Array();
|
||||
osg::Vec4Array* colors = new osg::Vec4Array();
|
||||
|
||||
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||
vertices->push_back(osg::Vec3(1.0f, 0.0f, 0.0f));
|
||||
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||
vertices->push_back(osg::Vec3(0.0f, 1.0f, 0.0f));
|
||||
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||
vertices->push_back(osg::Vec3(0.0f, 0.0f, 1.0f));
|
||||
|
||||
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
|
||||
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
||||
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
||||
|
||||
geometry->setVertexArray(vertices);
|
||||
geometry->setColorArray(colors);
|
||||
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
|
||||
geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||
|
||||
geode->addDrawable(geometry);
|
||||
|
||||
return geode;
|
||||
}
|
||||
|
||||
|
||||
struct AnimationManagerFinder : public osg::NodeVisitor
|
||||
{
|
||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> _am;
|
||||
AnimationManagerFinder() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
|
||||
void apply(osg::Node& node) {
|
||||
if (_am.valid())
|
||||
return;
|
||||
if (node.getUpdateCallback()) {
|
||||
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
|
||||
if (b) {
|
||||
_am = new osgAnimation::BasicAnimationManager(*b);
|
||||
return;
|
||||
}
|
||||
}
|
||||
traverse(node);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct AddHelperBone : public osg::NodeVisitor
|
||||
{
|
||||
AddHelperBone() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
|
||||
void apply(osg::Transform& node) {
|
||||
osgAnimation::Bone* bone = dynamic_cast<osgAnimation::Bone*>(&node);
|
||||
if (bone)
|
||||
bone->addChild(createAxis());
|
||||
traverse(node);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a 3d poker game client");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--drawbone","draw helps to display bones.");
|
||||
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
{
|
||||
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.argc()<=1)
|
||||
{
|
||||
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool drawBone = false;
|
||||
if (arguments.read("--drawbone"))
|
||||
drawBone = true;
|
||||
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
osg::ref_ptr<osg::Group> group = new osg::Group();
|
||||
|
||||
osg::Group* node = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(arguments)); //dynamic_cast<osgAnimation::AnimationManager*>(osgDB::readNodeFile(psr[1]));
|
||||
if(!node)
|
||||
{
|
||||
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Set our Singleton's model.
|
||||
AnimationManagerFinder finder;
|
||||
node->accept(finder);
|
||||
if (finder._am.valid()) {
|
||||
node->setUpdateCallback(finder._am.get());
|
||||
AnimtkViewerModelController::setModel(finder._am.get());
|
||||
} else {
|
||||
osg::notify(osg::WARN) << "no osgAnimation::AnimationManagerBase found in the subgraph, no animations available" << std::endl;
|
||||
}
|
||||
|
||||
if (drawBone) {
|
||||
osg::notify(osg::INFO) << "Add Bones Helper" << std::endl;
|
||||
AddHelperBone addHelper;
|
||||
node->accept(addHelper);
|
||||
}
|
||||
node->addChild(createAxis());
|
||||
|
||||
AnimtkViewerGUI* gui = new AnimtkViewerGUI(&viewer, WIDTH, HEIGHT, 0x1234);
|
||||
osg::Camera* camera = gui->createParentOrthoCamera();
|
||||
|
||||
node->setNodeMask(0x0001);
|
||||
|
||||
group->addChild(node);
|
||||
group->addChild(camera);
|
||||
|
||||
viewer.addEventHandler(new AnimtkKeyEventHandler());
|
||||
viewer.addEventHandler(new osgViewer::StatsHandler());
|
||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||
viewer.addEventHandler(new osgWidget::MouseHandler(gui));
|
||||
viewer.addEventHandler(new osgWidget::KeyboardHandler(gui));
|
||||
viewer.addEventHandler(new osgWidget::ResizeHandler(gui, camera));
|
||||
viewer.setSceneData(group.get());
|
||||
|
||||
viewer.setUpViewInWindow(40, 40, WIDTH, HEIGHT);
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Authors:
|
||||
|
||||
Jeremy Moles <jeremy@emperorlinux.com>
|
||||
Cedric Pinson <mornifle@plopbyte.net>
|
||||
*/
|
||||
|
||||
#ifndef ANIMTKVIEWERGUI_H
|
||||
#define ANIMTKVIEWERGUI_H
|
||||
|
||||
#include <osgWidget/WindowManager>
|
||||
|
||||
class AnimtkViewerGUI: public osgWidget::WindowManager {
|
||||
osg::ref_ptr<osgWidget::Box> _buttonBox;
|
||||
osg::ref_ptr<osgWidget::Box> _listBox;
|
||||
osg::ref_ptr<osgWidget::Box> _labelBox;
|
||||
|
||||
protected:
|
||||
osgWidget::Widget* _createButton(const std::string&);
|
||||
|
||||
bool _buttonPush(osgWidget::Event&);
|
||||
bool _listMouseHover(osgWidget::Event&);
|
||||
|
||||
void _createButtonBox();
|
||||
void _createListBox();
|
||||
void _createLabelBox();
|
||||
|
||||
public:
|
||||
AnimtkViewerGUI(osgViewer::View*, float, float, unsigned int);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,407 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
* Authors:
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
* jeremy Moles <jeremy@emperorlinux.com>
|
||||
*/
|
||||
|
||||
#include "AnimtkViewer"
|
||||
#include "AnimtkViewerGUI"
|
||||
|
||||
#include <osg/Version>
|
||||
#include <osgWidget/WindowManager>
|
||||
#include <osgAnimation/EaseMotion>
|
||||
|
||||
const std::string IMAGE_PATH = "osgWidget/";
|
||||
|
||||
template <class T>
|
||||
struct Sampler: public osg::Drawable::UpdateCallback
|
||||
{
|
||||
T _motion;
|
||||
Sampler() {
|
||||
}
|
||||
};
|
||||
|
||||
typedef Sampler<osgAnimation::OutQuadMotion> WidgetSampler;
|
||||
|
||||
struct ButtonFunctor: public WidgetSampler
|
||||
{
|
||||
float _direction;
|
||||
float _previous;
|
||||
|
||||
const float _speed;
|
||||
|
||||
ButtonFunctor(): _speed(5) { _direction = -_speed; _previous = 0;}
|
||||
|
||||
bool enter(osgWidget::Event&)
|
||||
{
|
||||
_direction = _speed;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool leave(osgWidget::Event&)
|
||||
{
|
||||
_direction = -_speed;
|
||||
return true;
|
||||
}
|
||||
|
||||
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
|
||||
{
|
||||
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||
float dt = f->getSimulationTime() - _previous;
|
||||
_previous = f->getSimulationTime();
|
||||
update(dt,dynamic_cast<osgWidget::Widget*>(geom));
|
||||
}
|
||||
|
||||
void update(float t, osgWidget::Widget* w)
|
||||
{
|
||||
if (!w) return;
|
||||
_motion.update(t*_direction);
|
||||
float val = _motion.getValue()*0.5;
|
||||
val += 0.5;
|
||||
if (val >= 1.0)
|
||||
val = 1.0;
|
||||
w->setColor(osg::Vec4(val, val, val, 1));
|
||||
}
|
||||
};
|
||||
|
||||
struct LabelFunctor: public WidgetSampler
|
||||
{
|
||||
float _previous;
|
||||
bool _active;
|
||||
|
||||
const float _fadeOutTime;
|
||||
|
||||
osgAnimation::OutCubicMotion _scaleSampler;
|
||||
|
||||
LabelFunctor():
|
||||
_fadeOutTime(1.5f)
|
||||
{
|
||||
_previous = 0.0f;
|
||||
_active = false;
|
||||
|
||||
_scaleSampler = osgAnimation::OutCubicMotion(0.5, 1.0, 1.0);
|
||||
}
|
||||
|
||||
void setActive(bool active)
|
||||
{
|
||||
_active = active;
|
||||
|
||||
if(active) _motion.reset();
|
||||
|
||||
_scaleSampler.reset();
|
||||
}
|
||||
|
||||
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
|
||||
{
|
||||
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||
|
||||
float st = f->getSimulationTime();
|
||||
float dt = st - _previous;
|
||||
|
||||
_previous = st;
|
||||
|
||||
if(!_active) return;
|
||||
|
||||
update(dt, dynamic_cast<osgWidget::Label*>(geom));
|
||||
updateScale(dt, dynamic_cast<osgWidget::Label*>(geom));
|
||||
}
|
||||
|
||||
void update(float t, osgWidget::Label* w)
|
||||
{
|
||||
if(!w) return;
|
||||
|
||||
_motion.update(t / _fadeOutTime);
|
||||
|
||||
float val = _motion.getValue();
|
||||
|
||||
if(val >= 1.0f) {
|
||||
_motion.reset();
|
||||
_active = false;
|
||||
}
|
||||
|
||||
w->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, (1.0f - val) * 0.7f));
|
||||
}
|
||||
|
||||
void updateScale(float t, osgWidget::Label* w)
|
||||
{
|
||||
_scaleSampler.update(t);
|
||||
float val = _scaleSampler.getValue();
|
||||
osgWidget::Window* win = w->getParent();
|
||||
win->setScale(val);
|
||||
win->update();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct ListFunctor: public osg::NodeCallback
|
||||
{
|
||||
float _previous;
|
||||
int _direction;
|
||||
|
||||
osgAnimation::InQuadMotion _transformSampler;
|
||||
|
||||
ListFunctor()
|
||||
{
|
||||
_direction = 1;
|
||||
_previous = 0;
|
||||
|
||||
_transformSampler.update(1.0f);
|
||||
}
|
||||
|
||||
void toggleShown()
|
||||
{
|
||||
if(_direction == 1) _direction = -1;
|
||||
|
||||
else _direction = 1;
|
||||
}
|
||||
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||
|
||||
float st = f->getSimulationTime();
|
||||
float dt = st - _previous;
|
||||
|
||||
_previous = st;
|
||||
|
||||
_transformSampler.update((dt * _direction) / 0.5f);
|
||||
|
||||
float val = _transformSampler.getValue();
|
||||
|
||||
if(val > 1.0f || val < 0.0f) return;
|
||||
|
||||
osgWidget::Window* win = dynamic_cast<osgWidget::Window*>(node);
|
||||
|
||||
float w = win->getWidth();
|
||||
float wmw = win->getWindowManager()->getWidth();
|
||||
|
||||
win->setX((wmw - w) + (val * w));
|
||||
win->update();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// This is a temporary hack to "prevent" dragging on Widgets and Windows.
|
||||
bool eatDrag(osgWidget::Event&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AnimtkViewerGUI::AnimtkViewerGUI(osgViewer::View* view, float w, float h, unsigned int mask):
|
||||
osgWidget::WindowManager(view, w, h, mask, 0)
|
||||
{
|
||||
_createButtonBox();
|
||||
_createLabelBox();
|
||||
_createListBox();
|
||||
|
||||
_labelBox->setAnchorHorizontal(osgWidget::Window::HA_LEFT);
|
||||
_labelBox->setY(74.0f);
|
||||
_labelBox->setVisibilityMode(osgWidget::Window::VM_ENTIRE);
|
||||
|
||||
_listBox->setOrigin(getWidth(), 74.0f);
|
||||
|
||||
addChild(_buttonBox.get());
|
||||
addChild(_labelBox.get());
|
||||
addChild(_listBox.get());
|
||||
|
||||
resizeAllWindows();
|
||||
|
||||
// Remember, you can't call resizePercent until AFTER the box is parented
|
||||
// by a WindowManager; how could it possibly resize itself if it doesn't know
|
||||
// how large it's viewable area is?
|
||||
_buttonBox->resizePercent(100.0f);
|
||||
_buttonBox->resizeAdd(0.0f, 10.0f);
|
||||
}
|
||||
|
||||
osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
|
||||
{
|
||||
osgWidget::Widget* b = new osgWidget::Widget(name, 64.0f, 64.0f);
|
||||
|
||||
if(!b) return 0;
|
||||
|
||||
b->setImage(IMAGE_PATH + name + ".png", true);
|
||||
b->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||
|
||||
ButtonFunctor* bt = new ButtonFunctor();
|
||||
b->setUpdateCallback(bt);
|
||||
|
||||
b->addCallback(new osgWidget::Callback(&ButtonFunctor::enter, bt, osgWidget::EVENT_MOUSE_ENTER));
|
||||
b->addCallback(new osgWidget::Callback(&ButtonFunctor::leave, bt, osgWidget::EVENT_MOUSE_LEAVE));
|
||||
b->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_buttonPush, this, osgWidget::EVENT_MOUSE_PUSH));
|
||||
b->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
|
||||
{
|
||||
osgWidget::Label* l = dynamic_cast<osgWidget::Label*>(ev.getWidget());
|
||||
|
||||
if(!l) return false;
|
||||
|
||||
if(ev.type == osgWidget::EVENT_MOUSE_ENTER) l->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
else if(ev.type == osgWidget::EVENT_MOUSE_LEAVE) l->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
|
||||
|
||||
else if(ev.type == osgWidget::EVENT_MOUSE_PUSH) {
|
||||
AnimtkViewerModelController::instance().playByName(ev.getWidget()->getName());
|
||||
}
|
||||
|
||||
else return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
|
||||
{
|
||||
if(!ev.getWidget()) return false;
|
||||
|
||||
osgWidget::Label* l = static_cast<osgWidget::Label*>(_labelBox->getByName("label"));
|
||||
|
||||
if(!l) return false;
|
||||
|
||||
LabelFunctor* lf = dynamic_cast<LabelFunctor*>(l->getUpdateCallback());
|
||||
|
||||
if(!lf) return false;
|
||||
|
||||
// We're safe at this point, so begin processing.
|
||||
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
|
||||
std::string name = ev.getWidget()->getName();
|
||||
|
||||
if(name == "play") mc.play();
|
||||
|
||||
else if(name == "stop") mc.stop();
|
||||
|
||||
else if(name == "next")
|
||||
{
|
||||
mc.next();
|
||||
|
||||
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
|
||||
l->setLabel(mc.getCurrentAnimationName());
|
||||
lf->setActive(true);
|
||||
}
|
||||
|
||||
else if(name == "back")
|
||||
{
|
||||
mc.previous();
|
||||
|
||||
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
|
||||
l->setLabel(mc.getCurrentAnimationName());
|
||||
lf->setActive(true);
|
||||
}
|
||||
|
||||
else if(name == "pause")
|
||||
{
|
||||
}
|
||||
|
||||
else if(name == "open")
|
||||
{
|
||||
ListFunctor* lsf = dynamic_cast<ListFunctor*>(_listBox->getUpdateCallback());
|
||||
|
||||
if(!lsf) return false;
|
||||
|
||||
lsf->toggleShown();
|
||||
}
|
||||
|
||||
else return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AnimtkViewerGUI::_createButtonBox()
|
||||
{
|
||||
_buttonBox = new osgWidget::Box("buttonBox", osgWidget::Box::HORIZONTAL);
|
||||
|
||||
osgWidget::Widget* space = new osgWidget::Widget("nullSpace", 0.0f, 0.0f);
|
||||
osgWidget::Widget* back = _createButton("back");
|
||||
osgWidget::Widget* next = _createButton("next");
|
||||
osgWidget::Widget* play = _createButton("play");
|
||||
osgWidget::Widget* pause = _createButton("pause");
|
||||
osgWidget::Widget* stop = _createButton("stop");
|
||||
osgWidget::Widget* open = _createButton("open");
|
||||
|
||||
space->setCanFill(true);
|
||||
space->setColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
_buttonBox->addWidget(space);
|
||||
_buttonBox->addWidget(back);
|
||||
_buttonBox->addWidget(next);
|
||||
_buttonBox->addWidget(play);
|
||||
_buttonBox->addWidget(pause);
|
||||
_buttonBox->addWidget(stop);
|
||||
_buttonBox->addWidget(open);
|
||||
_buttonBox->addWidget(osg::clone(space, "space1", osg::CopyOp::DEEP_COPY_ALL));
|
||||
_buttonBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||
|
||||
_buttonBox->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||
_buttonBox->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
|
||||
}
|
||||
|
||||
void AnimtkViewerGUI::_createListBox()
|
||||
{
|
||||
_listBox = new osgWidget::Box("listBox", osgWidget::Box::VERTICAL);
|
||||
|
||||
const AnimtkViewerModelController::AnimationMapVector& amv =
|
||||
AnimtkViewerModelController::instance().getAnimationMap()
|
||||
;
|
||||
|
||||
for(
|
||||
AnimtkViewerModelController::AnimationMapVector::const_iterator i = amv.begin();
|
||||
i != amv.end();
|
||||
i++
|
||||
)
|
||||
{
|
||||
osgWidget::Label* label = new osgWidget::Label(*i);
|
||||
|
||||
label->setCanFill(true);
|
||||
label->setFont("fonts/Vera.ttf");
|
||||
label->setFontSize(15);
|
||||
label->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
|
||||
label->setPadding(5.0f);
|
||||
label->setAlignHorizontal(osgWidget::Widget::HA_RIGHT);
|
||||
label->setLabel(*i);
|
||||
label->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_ENTER));
|
||||
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_LEAVE));
|
||||
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_PUSH));
|
||||
|
||||
_listBox->addWidget(label);
|
||||
}
|
||||
|
||||
ListFunctor* lf = new ListFunctor();
|
||||
|
||||
_listBox->setUpdateCallback(lf);
|
||||
_listBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||
}
|
||||
|
||||
void AnimtkViewerGUI::_createLabelBox()
|
||||
{
|
||||
_labelBox = new osgWidget::Box("labelBox", osgWidget::Box::VERTICAL);
|
||||
|
||||
osgWidget::Label* label = new osgWidget::Label("label");
|
||||
|
||||
label->setFont("fonts/Vera.ttf");
|
||||
label->setFontSize(50);
|
||||
label->setFontColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||
label->setAlignHorizontal(osgWidget::Widget::HA_LEFT);
|
||||
label->setPadding(10.0f);
|
||||
|
||||
LabelFunctor* lf = new LabelFunctor();
|
||||
label->setUpdateCallback(lf);
|
||||
|
||||
_labelBox->addWidget(label);
|
||||
_labelBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Authors:
|
||||
*
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ANIMTKVIEWER_KEYHANDLER_H
|
||||
#define ANIMTKVIEWER_KEYHANDLER_H
|
||||
|
||||
#include "AnimtkViewer"
|
||||
|
||||
#include <osgGA/GUIEventHandler>
|
||||
|
||||
class AnimtkKeyEventHandler : public osgGA::GUIEventHandler
|
||||
{
|
||||
public:
|
||||
AnimtkKeyEventHandler();
|
||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
|
||||
osg::Object*, osg::NodeVisitor*);
|
||||
void printUsage() const;
|
||||
|
||||
protected:
|
||||
|
||||
enum Binding
|
||||
{
|
||||
List,
|
||||
Help,
|
||||
Play,
|
||||
Next,
|
||||
Prev
|
||||
};
|
||||
|
||||
std::map<Binding, int> _actionKeys;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,63 +0,0 @@
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Authors:
|
||||
*
|
||||
* Cedric Pinson <mornifle@plopbyte.net>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "AnimtkViewerKeyHandler"
|
||||
|
||||
AnimtkKeyEventHandler::AnimtkKeyEventHandler()
|
||||
{
|
||||
_actionKeys[List] = 'l';
|
||||
_actionKeys[Help] = 'h';
|
||||
_actionKeys[Play] = 'p';
|
||||
_actionKeys[Next] = ']';
|
||||
_actionKeys[Prev] = '[';
|
||||
}
|
||||
|
||||
void AnimtkKeyEventHandler::printUsage() const
|
||||
{
|
||||
std::cout << (char) _actionKeys.find(Help)->second << " for Help" << std::endl;
|
||||
std::cout << (char) _actionKeys.find(List)->second << " for List" << std::endl;
|
||||
std::cout << (char) _actionKeys.find(Play)->second << " for Play" << std::endl;
|
||||
std::cout << (char) _actionKeys.find(Next)->second << " for select Next item" << std::endl;
|
||||
std::cout << (char) _actionKeys.find(Prev)->second << " for select Previous item" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
bool AnimtkKeyEventHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&,
|
||||
osg::Object*, osg::NodeVisitor*)
|
||||
{
|
||||
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
|
||||
if(ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
|
||||
{
|
||||
if (ea.getKey() == _actionKeys[List]) return mc.list();
|
||||
else if (ea.getKey() == _actionKeys[Play]) return mc.play();
|
||||
else if (ea.getKey() == _actionKeys[Next]) return mc.next();
|
||||
else if (ea.getKey() == _actionKeys[Prev]) return mc.previous();
|
||||
else if (ea.getKey() == _actionKeys[Help])
|
||||
{
|
||||
printUsage();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
SET(TARGET_SRC
|
||||
AnimtkViewer.cpp
|
||||
AnimtkViewerKeyHandler.cpp
|
||||
AnimtkViewerGUI.cpp
|
||||
)
|
||||
SET(TARGET_ADDED_LIBRARIES osgAnimation osgWidget)
|
||||
SETUP_EXAMPLE(osganimationviewer)
|
||||
@@ -1,4 +0,0 @@
|
||||
SET(TARGET_SRC osgautocapture.cpp )
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgautocapture)
|
||||
@@ -1,346 +0,0 @@
|
||||
/**
|
||||
* TODO:
|
||||
* 1) Change example to use offscreen rendering (pbuffer) so that it becomes a true commandline tool with now windows
|
||||
* 2) Make example work with other threading models than SingleThreaded
|
||||
* 3) Add support for autocapture to movies
|
||||
*
|
||||
*/
|
||||
#include <osg/ArgumentParser>
|
||||
#include <osg/CoordinateSystemNode>
|
||||
#include <osg/Matrix>
|
||||
#include <osg/NodeVisitor>
|
||||
|
||||
#include <osgUtil/IntersectionVisitor>
|
||||
#include <osgUtil/GLObjectsVisitor>
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
|
||||
#include <osgGA/DriveManipulator>
|
||||
#include <osgGA/FlightManipulator>
|
||||
#include <osgGA/KeySwitchMatrixManipulator>
|
||||
#include <osgGA/TerrainManipulator>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
|
||||
#include <osgTerrain/Terrain>
|
||||
#include <osgTerrain/GeometryTechnique>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
#include <osgViewer/Renderer>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
/** Helper class*/
|
||||
template<class T>
|
||||
class FindTopMostNodeOfTypeVisitor : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
FindTopMostNodeOfTypeVisitor():
|
||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||
_foundNode(0)
|
||||
{}
|
||||
|
||||
void apply(osg::Node& node)
|
||||
{
|
||||
T* result = dynamic_cast<T*>(&node);
|
||||
if (result)
|
||||
_foundNode = result;
|
||||
else
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
T* _foundNode;
|
||||
};
|
||||
|
||||
/** Convenience function*/
|
||||
template<class T>
|
||||
T* findTopMostNodeOfType(osg::Node* node)
|
||||
{
|
||||
if (!node) return 0;
|
||||
|
||||
FindTopMostNodeOfTypeVisitor<T> fnotv;
|
||||
node->accept(fnotv);
|
||||
|
||||
return fnotv._foundNode;
|
||||
}
|
||||
|
||||
/** Capture the frame buffer and write image to disk*/
|
||||
class WindowCaptureCallback : public osg::Camera::DrawCallback
|
||||
{
|
||||
public:
|
||||
WindowCaptureCallback(GLenum readBuffer, const std::string& name):
|
||||
_readBuffer(readBuffer),
|
||||
_fileName(name)
|
||||
{
|
||||
_image = new osg::Image;
|
||||
}
|
||||
|
||||
virtual void operator () (osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
glReadBuffer(_readBuffer);
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
osg::GraphicsContext* gc = renderInfo.getState()->getGraphicsContext();
|
||||
if (gc->getTraits())
|
||||
{
|
||||
GLenum pixelFormat;
|
||||
|
||||
if (gc->getTraits()->alpha)
|
||||
pixelFormat = GL_RGBA;
|
||||
else
|
||||
pixelFormat = GL_RGB;
|
||||
|
||||
int width = gc->getTraits()->width;
|
||||
int height = gc->getTraits()->height;
|
||||
|
||||
std::cout<<"Capture: size="<<width<<"x"<<height<<", format="<<(pixelFormat == GL_RGBA ? "GL_RGBA":"GL_RGB")<<std::endl;
|
||||
|
||||
_image->readPixels(0, 0, width, height, pixelFormat, GL_UNSIGNED_BYTE);
|
||||
}
|
||||
|
||||
if (!_fileName.empty())
|
||||
{
|
||||
std::cout << "Writing to: " << _fileName << std::endl;
|
||||
osgDB::writeImageFile(*_image, _fileName);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
GLenum _readBuffer;
|
||||
std::string _fileName;
|
||||
osg::ref_ptr<osg::Image> _image;
|
||||
mutable OpenThreads::Mutex _mutex;
|
||||
};
|
||||
|
||||
|
||||
/** Do Culling only while loading PagedLODs*/
|
||||
class CustomRenderer : public osgViewer::Renderer
|
||||
{
|
||||
public:
|
||||
CustomRenderer(osg::Camera* camera)
|
||||
: osgViewer::Renderer(camera),
|
||||
_cullOnly(true)
|
||||
{
|
||||
setTargetFrameRate(1);
|
||||
setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1);
|
||||
}
|
||||
|
||||
/** Set flag to omit drawing in renderingTraversals */
|
||||
void setCullOnly(bool on) { _cullOnly = on; }
|
||||
|
||||
virtual void operator () (osg::GraphicsContext* /*context*/)
|
||||
{
|
||||
if (_graphicsThreadDoesCull)
|
||||
{
|
||||
if (_cullOnly)
|
||||
cull();
|
||||
else
|
||||
cull_draw();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cull()
|
||||
{
|
||||
osgUtil::SceneView* sceneView = _sceneView[0].get();
|
||||
if (!sceneView || _done ) return;
|
||||
|
||||
updateSceneView(sceneView);
|
||||
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(_camera->getView());
|
||||
if (view) sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
|
||||
|
||||
sceneView->inheritCullSettings(*(sceneView->getCamera()));
|
||||
sceneView->cull();
|
||||
}
|
||||
|
||||
bool _cullOnly;
|
||||
};
|
||||
|
||||
|
||||
//===============================================================
|
||||
// MAIN
|
||||
//
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
osg::ApplicationUsage* usage = arguments.getApplicationUsage();
|
||||
|
||||
usage->setApplicationName(arguments.getApplicationName());
|
||||
usage->setDescription(arguments.getApplicationName()+" loads a model, sets a camera position and automatically captures screenshot to disk");
|
||||
usage->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||
usage->addCommandLineOption("--camera <lat> <lon> <alt> <heading> <incline> <roll>", "Specify camera position for image capture. Angles are specified in degrees and altitude in meters above sealevel (e.g. --camera 55 10 300000 0 30 0)");
|
||||
usage->addCommandLineOption("--filename", "Filename for the captured image", "autocapture.jpg");
|
||||
usage->addCommandLineOption("--db-threads", "Number of DatabasePager threads to use", "2");
|
||||
usage->addCommandLineOption("--active", "Use active rendering instead of passive / lazy rendering");
|
||||
|
||||
// Construct the viewer and register options arguments.
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
if (arguments.argc()<=1)
|
||||
{
|
||||
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Get user specified number of DatabaseThreads
|
||||
int dbThreads = 2;
|
||||
arguments.read("--db-threads", dbThreads);
|
||||
if (dbThreads < 1) dbThreads = 1;
|
||||
|
||||
osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint(dbThreads);
|
||||
|
||||
// Get user specified file name
|
||||
std::string fileName("autocapture.jpg");
|
||||
arguments.read("--filename", fileName);
|
||||
|
||||
// Rendering mode is passive by default
|
||||
bool activeMode = false;
|
||||
if (arguments.read("--active"))
|
||||
activeMode = true;
|
||||
|
||||
// Read camera settings for screenshot
|
||||
double lat=50;
|
||||
double lon=10;
|
||||
double alt=2000;
|
||||
double heading=0;
|
||||
double incline=45;
|
||||
double roll=0;
|
||||
bool camera_specified=false;
|
||||
if (arguments.read("--camera", lat, lon, alt, heading, incline, roll))
|
||||
{
|
||||
camera_specified=true;
|
||||
lat = osg::DegreesToRadians(lat);
|
||||
lon = osg::DegreesToRadians(lon);
|
||||
heading = osg::DegreesToRadians(heading);
|
||||
incline = osg::DegreesToRadians(incline);
|
||||
roll = osg::DegreesToRadians(roll);
|
||||
}
|
||||
|
||||
// load the data
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(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;
|
||||
}
|
||||
|
||||
// Setup specified camera
|
||||
if (camera_specified)
|
||||
{
|
||||
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
|
||||
if(!csn) return 1;
|
||||
|
||||
// Compute eye point in world coordiantes
|
||||
osg::Vec3d eye;
|
||||
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
|
||||
|
||||
// Build matrix for computing target vector
|
||||
osg::Matrixd target_matrix = osg::Matrixd::rotate(-heading, osg::Vec3d(1,0,0),
|
||||
-lat, osg::Vec3d(0,1,0),
|
||||
lon, osg::Vec3d(0,0,1));
|
||||
|
||||
// Compute tangent vector ...
|
||||
osg::Vec3d tangent = target_matrix.preMult(osg::Vec3d(0, 0, 1));
|
||||
|
||||
// Compute non-inclined, non-rolled up vector ...
|
||||
osg::Vec3d up(eye);
|
||||
up.normalize();
|
||||
|
||||
// Incline by rotating the target- and up vector around the tangent/up-vector
|
||||
// cross-product ...
|
||||
osg::Vec3d up_cross_tangent = up ^ tangent;
|
||||
osg::Matrixd incline_matrix = osg::Matrixd::rotate(incline, up_cross_tangent);
|
||||
osg::Vec3d target = incline_matrix.preMult(tangent);
|
||||
|
||||
// Roll by rotating the up vector around the target vector ...
|
||||
osg::Matrixd roll_matrix = incline_matrix * osg::Matrixd::rotate(roll, target);
|
||||
up = roll_matrix.preMult(up);
|
||||
|
||||
viewer.getCamera()->setViewMatrixAsLookAt(eye, eye+target, up);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only add camera manipulators if camera is not specified
|
||||
camera_specified=false;
|
||||
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() );
|
||||
}
|
||||
|
||||
|
||||
// Optimize DatabasePager for auto-capture
|
||||
osgDB::DatabasePager* pager = viewer.getDatabasePager();
|
||||
pager->setDoPreCompile(false);
|
||||
|
||||
// Install custom renderer
|
||||
osg::ref_ptr<CustomRenderer> customRenderer = new CustomRenderer(viewer.getCamera());
|
||||
viewer.getCamera()->setRenderer(customRenderer.get());
|
||||
|
||||
// Override threading model
|
||||
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||
|
||||
// Set the final SceneData to show
|
||||
viewer.setSceneData(loadedModel.get());
|
||||
|
||||
// Realize GUI
|
||||
viewer.realize();
|
||||
|
||||
//--- Load PageLOD tiles ---
|
||||
|
||||
// Initiate the first PagedLOD request
|
||||
viewer.frame();
|
||||
|
||||
osg::Timer_t beforeLoadTick = osg::Timer::instance()->tick();
|
||||
|
||||
// Keep updating and culling until full level of detail is reached
|
||||
while(!viewer.done() && pager->getRequestsInProgress())
|
||||
{
|
||||
// std::cout <<pager->getRequestsInProgress()<<" ";
|
||||
viewer.updateTraversal();
|
||||
viewer.renderingTraversals();
|
||||
}
|
||||
// std::cout<<std::endl;
|
||||
|
||||
osg::Timer_t afterLoadTick = osg::Timer::instance()->tick();
|
||||
std::cout<<"Load and Compile time = "<<osg::Timer::instance()->delta_s(beforeLoadTick, afterLoadTick)<<" seconds"<<std::endl;
|
||||
|
||||
|
||||
//--- Capture the image!!! ---
|
||||
if (!activeMode)
|
||||
{
|
||||
// Do cull and draw to render the scene correctly
|
||||
customRenderer->setCullOnly(false);
|
||||
|
||||
// Add the WindowCaptureCallback now that we have full resolution
|
||||
viewer.getCamera()->setFinalDrawCallback(new WindowCaptureCallback(GL_BACK, fileName));
|
||||
|
||||
osg::Timer_t beforeRenderTick = osg::Timer::instance()->tick();
|
||||
|
||||
// Do rendering with capture callback
|
||||
viewer.renderingTraversals();
|
||||
|
||||
osg::Timer_t afterRenderTick = osg::Timer::instance()->tick();
|
||||
std::cout<<"Rendring time = "<<osg::Timer::instance()->delta_s(beforeRenderTick, afterRenderTick) <<" seconds"<<std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return viewer.run();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
SET(TARGET_SRC
|
||||
osgbrowser.cpp
|
||||
)
|
||||
|
||||
SET(TARGET_ADDED_LIBRARIES osgWidget)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgbrowser)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
#include <osgWidget/Browser>
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
|
||||
osgWidget::BrowserManager::instance()->init(arguments[0]);
|
||||
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
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<osg::Group> group = new osg::Group;
|
||||
|
||||
for(int i=1; i<arguments.argc(); ++i)
|
||||
{
|
||||
if (!arguments.isOption(i))
|
||||
{
|
||||
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
|
||||
if (browser->open(arguments[i], hints))
|
||||
{
|
||||
group->addChild(browser.get());
|
||||
|
||||
hints.position.x() += 1.1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewer.setSceneData(group.get());
|
||||
|
||||
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
SET(TARGET_SRC
|
||||
broadcaster.cpp
|
||||
receiver.cpp
|
||||
osgcluster.cpp
|
||||
)
|
||||
|
||||
IF (WIN32)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ws2_32)
|
||||
ENDIF(WIN32)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgcluster)
|
||||
@@ -37,7 +37,7 @@
|
||||
#if defined(__linux)
|
||||
#include <unistd.h>
|
||||
#include <linux/sockios.h>
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <unistd.h>
|
||||
#include <sys/sockio.h>
|
||||
#elif defined(__sgi)
|
||||
@@ -164,7 +164,7 @@ void Broadcaster::setHost( const char *hostname )
|
||||
struct hostent *h;
|
||||
if( (h = gethostbyname( hostname )) == 0L )
|
||||
{
|
||||
fprintf( stderr, "Broadcaster::setHost() - Cannot resolve an address for \"%s\".\n", hostname );
|
||||
fprintf( stderr, "Broadcaster::setHost() - Cannot resolv an address for \"%s\".\n", hostname );
|
||||
_address = 0;
|
||||
}
|
||||
else
|
||||
@@ -196,7 +196,7 @@ void Broadcaster::sync( void )
|
||||
unsigned int size = sizeof( SOCKADDR_IN );
|
||||
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||
int err = WSAGetLastError ();
|
||||
if (err!=0) fprintf( stderr, "Broadcaster::sync() - error %d\n",err );
|
||||
int *dum = (int*) _buffer;
|
||||
#else
|
||||
unsigned int size = sizeof( struct sockaddr_in );
|
||||
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||
|
||||
@@ -386,7 +386,7 @@ class DataConverter
|
||||
_swapBytes = !_swapBytes;
|
||||
}
|
||||
|
||||
cameraPacket._masterKilled = readUInt()!=0;
|
||||
cameraPacket._masterKilled = readUInt();
|
||||
|
||||
read(cameraPacket._matrix);
|
||||
read(cameraPacket._frameStamp);
|
||||
@@ -413,7 +413,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
|
||||
|
||||
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
||||
{
|
||||
osg::notify(osg::INFO)<<"received events = "<<_events.size()<<std::endl;
|
||||
osg::notify(osg::INFO)<<"recieved events = "<<_events.size()<<std::endl;
|
||||
|
||||
viewer.getEventQueue()->appendEvents(_events);
|
||||
}
|
||||
@@ -437,7 +437,7 @@ int main( int argc, char **argv )
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-m","Set viewer to MASTER mode, sending view via packets.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, receiving view via packets.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, reciving view via packets.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-n <int>","Socket number to transmit packets");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-f <float>","Field of view of camera");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");
|
||||
|
||||
@@ -142,7 +142,7 @@ void Receiver::sync( void )
|
||||
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||
int err = WSAGetLastError ();
|
||||
if (err!=0) fprintf( stderr, "Receiver::sync() - error %d\n",err );
|
||||
int *dum = (int*) _buffer;
|
||||
|
||||
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
|
||||
{
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <osgUtil/Optimizer>
|
||||
#include <osgDB/ReadFile>
|
||||
|
||||
@@ -46,19 +44,19 @@
|
||||
|
||||
// class to handle events with a pick
|
||||
class PickHandler : public osgGA::GUIEventHandler {
|
||||
public:
|
||||
public:
|
||||
|
||||
PickHandler():
|
||||
_mx(0.0f),
|
||||
_my(0.0f) {}
|
||||
|
||||
|
||||
~PickHandler() {}
|
||||
|
||||
|
||||
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
|
||||
{
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||
if (!view) return false;
|
||||
|
||||
|
||||
switch(ea.getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::PUSH):
|
||||
@@ -80,7 +78,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void pick(osgViewer::View* view, float x, float y)
|
||||
{
|
||||
osg::Node* node = 0;
|
||||
@@ -93,7 +91,7 @@ public:
|
||||
osg::NodePath& nodePath = intersection.nodePath;
|
||||
node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0;
|
||||
parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0;
|
||||
}
|
||||
}
|
||||
|
||||
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
|
||||
if (parent && node)
|
||||
@@ -121,7 +119,7 @@ public:
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
float _mx, _my;
|
||||
|
||||
};
|
||||
@@ -132,28 +130,26 @@ int main( int argc, char **argv )
|
||||
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
|
||||
|
||||
if (!scene)
|
||||
{
|
||||
std::cout << argv[0] << ": requires filename argument." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
if (!scene) return 1;
|
||||
|
||||
// construct the viewer.
|
||||
osgViewer::CompositeViewer viewer(arguments);
|
||||
|
||||
|
||||
|
||||
|
||||
if (arguments.read("-1"))
|
||||
{
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("Single view");
|
||||
view->setSceneData(osgDB::readNodeFile("fountain.osg"));
|
||||
|
||||
|
||||
view->addEventHandler( new osgViewer::StatsHandler );
|
||||
|
||||
|
||||
view->setUpViewAcrossAllScreens();
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
viewer.addView(view);
|
||||
@@ -166,7 +162,6 @@ int main( int argc, char **argv )
|
||||
// view one
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View one");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setUpViewOnSingleScreen(0);
|
||||
@@ -179,31 +174,30 @@ int main( int argc, char **argv )
|
||||
|
||||
view->addEventHandler( statesetManipulator.get() );
|
||||
}
|
||||
|
||||
|
||||
// view two
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View two");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setUpViewOnSingleScreen(1);
|
||||
view->setSceneData(scene.get());
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
|
||||
|
||||
view->addEventHandler( new osgViewer::StatsHandler );
|
||||
|
||||
|
||||
|
||||
// add the handler for doing the picking
|
||||
view->addEventHandler(new PickHandler());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (arguments.read("-3") || viewer.getNumViews()==0)
|
||||
{
|
||||
{
|
||||
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
if (!wsi)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return 1;
|
||||
@@ -239,11 +233,9 @@ int main( int argc, char **argv )
|
||||
// view one
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View one");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setSceneData(scene.get());
|
||||
view->getCamera()->setName("Cam one");
|
||||
view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2));
|
||||
view->getCamera()->setGraphicsContext(gc.get());
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
@@ -253,7 +245,7 @@ int main( int argc, char **argv )
|
||||
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
|
||||
|
||||
view->addEventHandler( statesetManipulator.get() );
|
||||
|
||||
|
||||
view->addEventHandler( new osgViewer::StatsHandler );
|
||||
view->addEventHandler( new osgViewer::HelpHandler );
|
||||
view->addEventHandler( new osgViewer::WindowSizeHandler );
|
||||
@@ -264,29 +256,25 @@ int main( int argc, char **argv )
|
||||
// view two
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View two");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setSceneData(scene.get());
|
||||
view->getCamera()->setName("Cam two");
|
||||
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2));
|
||||
view->getCamera()->setGraphicsContext(gc.get());
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
|
||||
|
||||
// add the handler for doing the picking
|
||||
view->addEventHandler(new PickHandler());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// view three
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View three");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setSceneData(osgDB::readNodeFile("cessnafire.osg"));
|
||||
|
||||
view->getCamera()->setName("Cam three");
|
||||
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);
|
||||
view->getCamera()->setViewport(new osg::Viewport(0, traits->height/2, traits->width, traits->height/2));
|
||||
view->getCamera()->setGraphicsContext(gc.get());
|
||||
@@ -295,12 +283,11 @@ int main( int argc, char **argv )
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::CompositeViewer::SingleThreaded); }
|
||||
while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullDrawThreadPerContext); }
|
||||
while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext); }
|
||||
|
||||
|
||||
// run the viewer's main frame loop
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Geode>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/fstream>
|
||||
|
||||
bool Utility::readFile(const char* fName, std::string& s)
|
||||
{
|
||||
std::string foundFile = osgDB::findDataFile(fName);
|
||||
if (foundFile.empty()) return false;
|
||||
|
||||
osgDB::ifstream is;//(fName);
|
||||
std::ifstream is;//(fName);
|
||||
is.open(foundFile.c_str());
|
||||
if (is.fail())
|
||||
{
|
||||
@@ -73,7 +73,7 @@ double Utility::getNoise(unsigned x, unsigned y, unsigned random)
|
||||
int n = x + y * 57 + random * 131;
|
||||
n = (n<<13) ^ n;
|
||||
double noise = (1.0f - ( (n * (n * n * 15731 + 789221) +
|
||||
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
|
||||
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
|
||||
return noise;
|
||||
}
|
||||
|
||||
@@ -86,13 +86,13 @@ double Utility::smoothNoise(unsigned width, unsigned height, unsigned x, unsigne
|
||||
return noise[x + y*width];
|
||||
|
||||
double corners = (noise[x-1 + (y-1) *width]
|
||||
+noise[x+1 + (y-1)*width]
|
||||
+noise[x-1 + (y+1) * width]
|
||||
+noise[x+1 + (y+1) * width]) / 16.0;
|
||||
+noise[x+1 + (y-1)*width]
|
||||
+noise[x-1 + (y+1) * width]
|
||||
+noise[x+1 + (y+1) * width]) / 16.0;
|
||||
double sides = (noise[x-1 + y*width]
|
||||
+noise[x+1 + y*width]
|
||||
+noise[x + (y-1)*width]
|
||||
+noise[x + (y+1)*width]) / 8.0;
|
||||
+noise[x+1 + y*width]
|
||||
+noise[x + (y-1)*width]
|
||||
+noise[x + (y+1)*width]) / 8.0;
|
||||
double center = noise[x + y*width] / 4.0;
|
||||
|
||||
return corners + sides + center;
|
||||
|
||||
@@ -174,12 +174,27 @@ public:
|
||||
private:
|
||||
void rotate(float x, float y)
|
||||
{
|
||||
osg::Matrix baseMatrix = _modelGroupTransform->getMatrix();
|
||||
osg::Matrixd baseMatrix = _modelGroupTransform->getMatrix();
|
||||
|
||||
baseMatrix.preMultTranslate(_rotCenter);
|
||||
baseMatrix.preMultRotate(osg::Quat((x - _prevX) * 3, osg::Vec3d(0.0, 0.0, 1.0)));
|
||||
baseMatrix.preMultRotate(osg::Quat(-(y - _prevY) * 3, (baseMatrix * osg::Vec3d(1.0, 0.0, 0.0))));
|
||||
baseMatrix.preMultTranslate(-_rotCenter);
|
||||
osg::Matrixd preTransMatrix;
|
||||
osg::Matrixd postTransMatrix;
|
||||
osg::Matrixd rotMatrixX;
|
||||
osg::Matrixd rotMatrixZ;
|
||||
|
||||
preTransMatrix.makeTranslate(_rotCenter);
|
||||
postTransMatrix.makeTranslate(-_rotCenter);
|
||||
|
||||
rotMatrixZ.makeRotate((x - _prevX) * 3., osg::Vec3d(0.0, 0.0,1.0));
|
||||
|
||||
baseMatrix.preMult(preTransMatrix);
|
||||
baseMatrix.preMult(rotMatrixZ);
|
||||
baseMatrix.preMult(postTransMatrix);
|
||||
|
||||
rotMatrixX.makeRotate(-(y - _prevY) * 3., (baseMatrix * osg::Vec3d(1.0, 0.0,0.0)));
|
||||
|
||||
baseMatrix.preMult(preTransMatrix);
|
||||
baseMatrix.preMult(rotMatrixX);
|
||||
baseMatrix.preMult(postTransMatrix);
|
||||
|
||||
_modelGroupTransform->setMatrix(baseMatrix);
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
SET(TARGET_SRC osgdrawinstanced.cpp )
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgdrawinstanced)
|
||||
@@ -1,150 +0,0 @@
|
||||
/* OpenSceneGraph example, osgdrawinstanced.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
//
|
||||
// This code is copyright (c) 2008 Skew Matrix Software LLC. You may use
|
||||
// the code under the licensing terms described above.
|
||||
//
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Texture2D>
|
||||
|
||||
#include <osgDB/WriteFile>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void
|
||||
createDAIGeometry( osg::Geometry& geom, int nInstances=1 )
|
||||
{
|
||||
const float halfDimX( .5 );
|
||||
const float halfDimZ( .5 );
|
||||
|
||||
osg::Vec3Array* v = new osg::Vec3Array;
|
||||
v->resize( 4 );
|
||||
geom.setVertexArray( v );
|
||||
|
||||
// Geometry for a single quad.
|
||||
(*v)[ 0 ] = osg::Vec3( -halfDimX, 0., -halfDimZ );
|
||||
(*v)[ 1 ] = osg::Vec3( halfDimX, 0., -halfDimZ );
|
||||
(*v)[ 2 ] = osg::Vec3( halfDimX, 0., halfDimZ );
|
||||
(*v)[ 3 ] = osg::Vec3( -halfDimX, 0., halfDimZ );
|
||||
|
||||
// Use the DrawArraysInstanced PrimitiveSet and tell it to draw 1024 instances.
|
||||
geom.addPrimitiveSet( new osg::DrawArrays( GL_QUADS, 0, 4, nInstances ) );
|
||||
}
|
||||
|
||||
|
||||
osg::StateSet*
|
||||
createStateSet()
|
||||
{
|
||||
osg::ref_ptr< osg::StateSet > ss = new osg::StateSet;
|
||||
|
||||
// Create a vertex program that references the gl_InstanceID to
|
||||
// render each instance uniquely. gl_InstanceID will be in the range
|
||||
// 0 to numInstances-1 (1023 in our case).
|
||||
std::string vertexSource =
|
||||
"uniform sampler2D osgLogo; \n"
|
||||
"uniform float osg_SimulationTime; \n"
|
||||
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
// Using the instance ID, generate "texture coords" for this instance.
|
||||
"vec2 tC; \n"
|
||||
"const float r = gl_InstanceID / 32.; \n"
|
||||
"tC.s = fract( r ); tC.t = floor( r ) / 32.; \n"
|
||||
// Get the color from the OSG logo.
|
||||
"gl_FrontColor = texture2D( osgLogo, tC ); \n"
|
||||
|
||||
// Use the (scaled) tex coord to translate the position of the vertices.
|
||||
"vec4 pos = vec4( tC.s * 48., 0., tC.t * 48., 1. ); \n"
|
||||
|
||||
// Compute a rotation angle from the instanceID and elapsed time.
|
||||
"float timeOffset = gl_InstanceID / (32. * 32.); \n"
|
||||
"float angle = ( osg_SimulationTime - timeOffset ) * 6.283; \n"
|
||||
"float sa = sin( angle ); \n"
|
||||
"float ca = cos( angle ); \n"
|
||||
// New orientation, rotate around z axis.
|
||||
"vec4 newX = vec4( ca, sa, 0., 0. ); \n"
|
||||
"vec4 newY = vec4( sa, ca, 0., 0. ); \n"
|
||||
"vec4 newZ = vec4( 0., 0., 1., 0. ); \n"
|
||||
"mat4 mV = mat4( newX, newY, newZ, pos ); \n"
|
||||
"gl_Position = ( gl_ModelViewProjectionMatrix * mV * gl_Vertex ); \n"
|
||||
"} \n";
|
||||
|
||||
osg::ref_ptr< osg::Shader > vertexShader = new osg::Shader();
|
||||
vertexShader->setType( osg::Shader::VERTEX );
|
||||
vertexShader->setShaderSource( vertexSource );
|
||||
|
||||
osg::ref_ptr< osg::Program > program = new osg::Program();
|
||||
program->addShader( vertexShader.get() );
|
||||
|
||||
ss->setAttribute( program.get(),
|
||||
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED );
|
||||
|
||||
osg::ref_ptr< osg::Image> iLogo = osgDB::readImageFile( "Images/osg128.png" );
|
||||
if( !iLogo.valid() )
|
||||
{
|
||||
osg::notify( osg::ALWAYS ) << "Can't open image file osg128.png" << std::endl;
|
||||
return( NULL );
|
||||
}
|
||||
osg::Texture2D* texLogo = new osg::Texture2D( iLogo.get() );
|
||||
texLogo->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR );
|
||||
texLogo->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR );
|
||||
|
||||
ss->setTextureAttribute( 0, texLogo );
|
||||
|
||||
osg::ref_ptr< osg::Uniform > texLogoUniform =
|
||||
new osg::Uniform( "osgLogo", 0 );
|
||||
ss->addUniform( texLogoUniform.get() );
|
||||
|
||||
return( ss.release() );
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
|
||||
// Make a scene graph consisting of a single Geode, containing
|
||||
// a single Geometry, and a single PrimitiveSet.
|
||||
osg::ref_ptr< osg::Geode > geode = new osg::Geode;
|
||||
|
||||
osg::ref_ptr< osg::Geometry > geom = new osg::Geometry;
|
||||
// Configure the Geometry for use with EXT_draw_arrays:
|
||||
// DL off and buffer objects on.
|
||||
geom->setUseDisplayList( false );
|
||||
geom->setUseVertexBufferObjects( true );
|
||||
// OSG has no clue where out vertex shader will place the geometric data,
|
||||
// so specify an initial bound to allow proper culling and near/far computation.
|
||||
osg::BoundingBox bb( -1., -.1, -1., 49., 1., 49. );
|
||||
geom->setInitialBound( bb );
|
||||
// Add geometric data and the PrimitiveSet. Specify numInstances as 32*32 or 1024.
|
||||
createDAIGeometry( *geom, 32*32 );
|
||||
geode->addDrawable( geom.get() );
|
||||
|
||||
// Create a StateSet to render the instanced Geometry.
|
||||
osg::ref_ptr< osg::StateSet > ss = createStateSet();
|
||||
geode->setStateSet( ss.get() );
|
||||
|
||||
// osgDB::writeNodeFile(*geode, "instanced.osg");
|
||||
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
viewer.setSceneData( geode.get() );
|
||||
return viewer.run();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ void textInfo(osgText::Text* text)
|
||||
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
|
||||
|
||||
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
|
||||
|
||||
|
||||
const osgText::Text::GlyphQuads& gq = tgqmi->second;
|
||||
|
||||
osgText::String& s = text->getText();
|
||||
@@ -59,7 +59,7 @@ osg::Camera* createOrthoCamera(double width, double height)
|
||||
camera->setViewMatrix(osg::Matrix::identity());
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
|
||||
return camera;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ int main(int argc, char** argv)
|
||||
// Make sure we have the minimum args...
|
||||
if(argc <= 2)
|
||||
{
|
||||
osg::notify(osg::FATAL) << "usage: " << args[0] << " fontfile size1 [size2 ...]" << std::endl;
|
||||
osg::notify(osg::FATAL) << "usage: " << args[0] << " FONTFILE [sizes...]" << std::endl;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ int main(int argc, char** argv)
|
||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||
|
||||
osg::Group* group = new osg::Group();
|
||||
osg::Camera* camera = createOrthoCamera(1280.0f, 1024.0f);
|
||||
osg::Camera* camera = createOrthoCamera(1280.0f, 1024.0f);
|
||||
|
||||
// Create the list of desired sizes.
|
||||
Sizes sizes;
|
||||
@@ -138,4 +138,3 @@ int main(int argc, char** argv)
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,15 +36,12 @@
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <osgUtil/LineSegmentIntersector>
|
||||
#include <osgUtil/IntersectionVisitor>
|
||||
#include <osgUtil/IntersectVisitor>
|
||||
#include <osgUtil/SmoothingVisitor>
|
||||
|
||||
#include <osgText/Text>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
#include <osgGA/StateSetManipulator>
|
||||
|
||||
#include <iostream>
|
||||
@@ -511,22 +508,22 @@ void ForestTechniqueManager::createTreeList(osg::Node* terrain,const osg::Vec3&
|
||||
|
||||
if (terrain)
|
||||
{
|
||||
osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector =
|
||||
new osgUtil::LineSegmentIntersector(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
|
||||
osgUtil::IntersectVisitor iv;
|
||||
osg::ref_ptr<osg::LineSegment> segDown = new osg::LineSegment;
|
||||
|
||||
osgUtil::IntersectionVisitor iv(intersector.get());
|
||||
segDown->set(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
|
||||
iv.addLineSegment(segDown.get());
|
||||
|
||||
terrain->accept(iv);
|
||||
|
||||
if (intersector->containsIntersections())
|
||||
if (iv.hits())
|
||||
{
|
||||
osgUtil::LineSegmentIntersector::Intersections& intersections = intersector->getIntersections();
|
||||
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
|
||||
itr != intersections.end();
|
||||
++itr)
|
||||
osgUtil::IntersectVisitor::HitList& hitList = iv.getHitList(segDown.get());
|
||||
if (!hitList.empty())
|
||||
{
|
||||
const osgUtil::LineSegmentIntersector::Intersection& intersection = *itr;
|
||||
tree->_position = intersection.getWorldIntersectPoint();
|
||||
osg::Vec3 ip = hitList.front().getWorldIntersectPoint();
|
||||
osg::Vec3 np = hitList.front().getWorldIntersectNormal();
|
||||
tree->_position = ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1102,9 +1099,6 @@ int main( int argc, char **argv )
|
||||
|
||||
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
||||
|
||||
// add the stats handler
|
||||
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||
|
||||
viewer.addEventHandler(new TechniqueEventHandler(ttm.get()));
|
||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
SET(TARGET_SRC
|
||||
GameOfLifePass.cpp
|
||||
osggameoflife.cpp
|
||||
)
|
||||
|
||||
SET(TARGET_H
|
||||
GameOfLifePass.h
|
||||
)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osggameoflife)
|
||||
@@ -1,204 +0,0 @@
|
||||
/* OpenSceneGraph example, osggameoflife.
|
||||
*
|
||||
* 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 "GameOfLifePass.h"
|
||||
#include <osgDB/FileUtils>
|
||||
#include <iostream>
|
||||
|
||||
ProcessPass::ProcessPass(osg::TextureRectangle *in_tex,
|
||||
osg::TextureRectangle *out_tex,
|
||||
int width, int height):
|
||||
_TextureWidth(width),
|
||||
_TextureHeight(height)
|
||||
{
|
||||
_RootGroup = new osg::Group;
|
||||
|
||||
_InTexture = in_tex;
|
||||
_OutTexture = out_tex;
|
||||
|
||||
_Camera = new osg::Camera;
|
||||
setupCamera();
|
||||
_Camera->addChild(createTexturedQuad().get());
|
||||
|
||||
_RootGroup->addChild(_Camera.get());
|
||||
|
||||
setShader("shaders/gameoflife.frag");
|
||||
}
|
||||
|
||||
ProcessPass::~ProcessPass()
|
||||
{
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Group> ProcessPass::createTexturedQuad()
|
||||
{
|
||||
osg::ref_ptr<osg::Group> top_group = new osg::Group;
|
||||
|
||||
osg::ref_ptr<osg::Geode> quad_geode = new osg::Geode;
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> quad_coords = new osg::Vec3Array; // vertex coords
|
||||
// counter-clockwise
|
||||
quad_coords->push_back(osg::Vec3d(0, 0, -1));
|
||||
quad_coords->push_back(osg::Vec3d(1, 0, -1));
|
||||
quad_coords->push_back(osg::Vec3d(1, 1, -1));
|
||||
quad_coords->push_back(osg::Vec3d(0, 1, -1));
|
||||
|
||||
osg::ref_ptr<osg::Vec2Array> quad_tcoords = new osg::Vec2Array; // texture coords
|
||||
quad_tcoords->push_back(osg::Vec2(0, 0));
|
||||
quad_tcoords->push_back(osg::Vec2(_TextureWidth, 0));
|
||||
quad_tcoords->push_back(osg::Vec2(_TextureWidth, _TextureHeight));
|
||||
quad_tcoords->push_back(osg::Vec2(0, _TextureHeight));
|
||||
|
||||
osg::ref_ptr<osg::Geometry> quad_geom = new osg::Geometry;
|
||||
osg::ref_ptr<osg::DrawArrays> quad_da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
|
||||
|
||||
osg::ref_ptr<osg::Vec4Array> quad_colors = new osg::Vec4Array;
|
||||
quad_colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||
|
||||
quad_geom->setVertexArray(quad_coords.get());
|
||||
quad_geom->setTexCoordArray(0, quad_tcoords.get());
|
||||
quad_geom->addPrimitiveSet(quad_da.get());
|
||||
quad_geom->setColorArray(quad_colors.get());
|
||||
quad_geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||
|
||||
_StateSet = quad_geom->getOrCreateStateSet();
|
||||
_StateSet->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
|
||||
_StateSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
|
||||
|
||||
_StateSet->setTextureAttributeAndModes(0, _InTexture.get(), osg::StateAttribute::ON);
|
||||
|
||||
_StateSet->addUniform(new osg::Uniform("textureIn", 0));
|
||||
|
||||
quad_geode->addDrawable(quad_geom.get());
|
||||
|
||||
top_group->addChild(quad_geode.get());
|
||||
|
||||
return top_group;
|
||||
}
|
||||
|
||||
void ProcessPass::setupCamera()
|
||||
{
|
||||
// clearing
|
||||
_Camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// projection and view
|
||||
_Camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
|
||||
_Camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
_Camera->setViewMatrix(osg::Matrix::identity());
|
||||
|
||||
// viewport
|
||||
_Camera->setViewport(0, 0, _TextureWidth, _TextureHeight);
|
||||
|
||||
_Camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
_Camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
_Camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER), _OutTexture.get());
|
||||
}
|
||||
|
||||
void ProcessPass::setShader(std::string filename)
|
||||
{
|
||||
std::string foundFile = osgDB::findDataFile(filename);
|
||||
if (foundFile.empty())
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Could not file shader file: "<<filename<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Shader> fshader = new osg::Shader( osg::Shader::FRAGMENT );
|
||||
fshader->loadShaderSourceFromFile(foundFile);
|
||||
|
||||
_FragmentProgram = 0;
|
||||
_FragmentProgram = new osg::Program;
|
||||
|
||||
_FragmentProgram->addShader(fshader.get());
|
||||
|
||||
_StateSet->setAttributeAndModes(_FragmentProgram.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GameOfLifePass::GameOfLifePass(osg::Image *in_image)
|
||||
{
|
||||
_TextureWidth = in_image->s();
|
||||
_TextureHeight = in_image->t();
|
||||
|
||||
_RootGroup = new osg::Group;
|
||||
|
||||
_BranchSwith[0] = new osg::Switch;
|
||||
_BranchSwith[1] = new osg::Switch;
|
||||
|
||||
_RootGroup->addChild(_BranchSwith[0].get());
|
||||
_RootGroup->addChild(_BranchSwith[1].get());
|
||||
|
||||
_ActiveBranch = 0;
|
||||
activateBranch();
|
||||
|
||||
createOutputTextures();
|
||||
_InOutTextureLife[0]->setImage(in_image);
|
||||
|
||||
_ProcessPass[0] = new ProcessPass(_InOutTextureLife[0].get(),
|
||||
_InOutTextureLife[1].get(),
|
||||
_TextureWidth, _TextureHeight);
|
||||
|
||||
// For the other pass, the input/output textures are flipped
|
||||
_ProcessPass[1] = new ProcessPass(_InOutTextureLife[1].get(),
|
||||
_InOutTextureLife[0].get(),
|
||||
_TextureWidth, _TextureHeight);
|
||||
|
||||
_BranchSwith[0]->addChild(_ProcessPass[0]->getRoot().get());
|
||||
_BranchSwith[1]->addChild(_ProcessPass[1]->getRoot().get());
|
||||
}
|
||||
|
||||
GameOfLifePass::~GameOfLifePass()
|
||||
{
|
||||
delete _ProcessPass[0];
|
||||
delete _ProcessPass[1];
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::TextureRectangle> GameOfLifePass::getOutputTexture()
|
||||
{
|
||||
int out_tex = (_ActiveBranch == 0) ? 1 : 0;
|
||||
return _ProcessPass[out_tex]->getOutputTexture();
|
||||
}
|
||||
|
||||
void GameOfLifePass::activateBranch()
|
||||
{
|
||||
int onb = _ActiveBranch;
|
||||
int offb = (onb == 1) ? 0 : 1;
|
||||
|
||||
_BranchSwith[onb]->setAllChildrenOn();
|
||||
_BranchSwith[offb]->setAllChildrenOff();
|
||||
}
|
||||
|
||||
void GameOfLifePass::flip()
|
||||
{
|
||||
_ActiveBranch = (_ActiveBranch == 1) ? 0 : 1;
|
||||
activateBranch();
|
||||
}
|
||||
|
||||
void GameOfLifePass::createOutputTextures()
|
||||
{
|
||||
for (int i=0; i<2; i++) {
|
||||
_InOutTextureLife[i] = new osg::TextureRectangle;
|
||||
|
||||
_InOutTextureLife[i]->setTextureSize(_TextureWidth, _TextureHeight);
|
||||
_InOutTextureLife[i]->setInternalFormat(GL_RGBA);
|
||||
_InOutTextureLife[i]->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);
|
||||
_InOutTextureLife[i]->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/* OpenSceneGraph example, osggameoflife.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef GAMEOFLIFEPASS_H
|
||||
#define GAMEOFLIFEPASS_H 1
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
#include <osg/Group>
|
||||
#include <osg/Switch>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/TextureRectangle>
|
||||
|
||||
class ProcessPass {
|
||||
public:
|
||||
ProcessPass(osg::TextureRectangle *in_tex,
|
||||
osg::TextureRectangle *out_tex,
|
||||
int width, int height);
|
||||
~ProcessPass();
|
||||
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
|
||||
osg::ref_ptr<osg::TextureRectangle> getOutputTexture() { return _OutTexture; }
|
||||
void setShader(std::string filename);
|
||||
|
||||
private:
|
||||
osg::ref_ptr<osg::Group> createTexturedQuad();
|
||||
void setupCamera();
|
||||
|
||||
osg::ref_ptr<osg::Group> _RootGroup;
|
||||
osg::ref_ptr<osg::Camera> _Camera;
|
||||
osg::ref_ptr<osg::TextureRectangle> _InTexture;
|
||||
osg::ref_ptr<osg::TextureRectangle> _OutTexture;
|
||||
int _TextureWidth;
|
||||
int _TextureHeight;
|
||||
osg::ref_ptr<osg::Program> _FragmentProgram;
|
||||
osg::ref_ptr<osg::StateSet> _StateSet;
|
||||
};
|
||||
|
||||
class GameOfLifePass {
|
||||
public:
|
||||
GameOfLifePass(osg::Image *in_image);
|
||||
~GameOfLifePass();
|
||||
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
|
||||
osg::ref_ptr<osg::TextureRectangle> getOutputTexture();
|
||||
void setShader(std::string filename);
|
||||
// Switch branches so we flip textures
|
||||
void flip();
|
||||
|
||||
private:
|
||||
osg::ref_ptr<osg::Group> createTexturedQuad();
|
||||
void setupCamera();
|
||||
void createOutputTextures();
|
||||
void activateBranch();
|
||||
|
||||
osg::ref_ptr<osg::Group> _RootGroup;
|
||||
osg::ref_ptr<osg::Camera> _Camera;
|
||||
osg::ref_ptr<osg::TextureRectangle> _InOutTextureLife[2];
|
||||
int _TextureWidth;
|
||||
int _TextureHeight;
|
||||
int _ActiveBranch;
|
||||
osg::ref_ptr<osg::Program> _FragmentProgram;
|
||||
osg::ref_ptr<osg::StateSet> _StateSet;
|
||||
osg::ref_ptr<osg::Switch> _BranchSwith[2];
|
||||
ProcessPass *_ProcessPass[2];
|
||||
};
|
||||
|
||||
#endif //GAMEOFLIFEPASS_H
|
||||
@@ -1,154 +0,0 @@
|
||||
/* OpenSceneGraph example, osggameoflife.
|
||||
*
|
||||
* 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 <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Geode>
|
||||
#include <osg/TextureRectangle>
|
||||
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/ReadFile>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
#include <osgGA/TrackballManipulator>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "GameOfLifePass.h"
|
||||
|
||||
GameOfLifePass *golpass;
|
||||
osg::ref_ptr<osg::StateSet> geomss; // stateset where we can attach textures
|
||||
|
||||
osg::Node* createScene(osg::Image *start_im)
|
||||
{
|
||||
int width = start_im->s();
|
||||
int height = start_im->t();
|
||||
|
||||
osg::Group* topnode = new osg::Group;
|
||||
|
||||
// create quad to display image on
|
||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
|
||||
|
||||
// each geom will contain a quad
|
||||
osg::ref_ptr<osg::DrawArrays> da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
|
||||
|
||||
osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array;
|
||||
colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||
|
||||
osg::ref_ptr<osg::Vec2Array> tcoords = new osg::Vec2Array; // texture coords
|
||||
tcoords->push_back(osg::Vec2(0, 0));
|
||||
tcoords->push_back(osg::Vec2(width, 0));
|
||||
tcoords->push_back(osg::Vec2(width, height));
|
||||
tcoords->push_back(osg::Vec2(0, height));
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> vcoords = new osg::Vec3Array; // vertex coords
|
||||
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
|
||||
|
||||
// initial viewer camera looks along y
|
||||
vcoords->push_back(osg::Vec3d(0, 0, 0));
|
||||
vcoords->push_back(osg::Vec3d(width, 0, 0));
|
||||
vcoords->push_back(osg::Vec3d(width, 0, height));
|
||||
vcoords->push_back(osg::Vec3d(0, 0, height));
|
||||
|
||||
geom->setVertexArray(vcoords.get());
|
||||
geom->setTexCoordArray(0,tcoords.get());
|
||||
geom->addPrimitiveSet(da.get());
|
||||
geom->setColorArray(colors.get());
|
||||
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||
geomss = geom->getOrCreateStateSet();
|
||||
geomss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||
|
||||
geode->addDrawable(geom.get());
|
||||
|
||||
topnode->addChild(geode.get());
|
||||
|
||||
// create the ping pong processing passes
|
||||
golpass = new GameOfLifePass(start_im);
|
||||
topnode->addChild(golpass->getRoot().get());
|
||||
|
||||
// attach the output of the processing to the geom
|
||||
geomss->setTextureAttributeAndModes(0,
|
||||
golpass->getOutputTexture().get(),
|
||||
osg::StateAttribute::ON);
|
||||
return topnode;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
// set up the usage document, in case we need to print out how to use this program.
|
||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and mutliple rendering branches. It uses Conway's Game of Life to illustrate the concept.");
|
||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with.");
|
||||
|
||||
// if user request help write it out to cout.
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
{
|
||||
arguments.getApplicationUsage()->write(std::cout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string startName("");
|
||||
while(arguments.read("--startim", startName)) {}
|
||||
|
||||
if (startName == "") {
|
||||
arguments.getApplicationUsage()->write(std::cout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// load the image
|
||||
osg::ref_ptr<osg::Image> startIm = osgDB::readImageFile(startName);
|
||||
|
||||
if (!startIm) {
|
||||
std::cout << "Could not load start image.\n";
|
||||
return(1);
|
||||
}
|
||||
|
||||
osg::Node* scene = createScene(startIm.get());
|
||||
|
||||
// construct the viewer.
|
||||
osgViewer::Viewer viewer;
|
||||
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||
|
||||
// add the stats handler
|
||||
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||
|
||||
viewer.setSceneData(scene);
|
||||
|
||||
viewer.realize();
|
||||
viewer.setCameraManipulator( new osgGA::TrackballManipulator );
|
||||
|
||||
while(!viewer.done())
|
||||
{
|
||||
viewer.frame();
|
||||
// flip the textures after we've completed a frame
|
||||
golpass->flip();
|
||||
// attach the proper output to view
|
||||
geomss->setTextureAttributeAndModes(0,
|
||||
golpass->getOutputTexture().get(),
|
||||
osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ int main( int argc, char **argv )
|
||||
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
|
||||
if (!rootnode)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Please specify a geo model filename on the command line."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Please specify and geo model filename on the command line."<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,12 +84,11 @@ static const char* geomSource = {
|
||||
"#version 120\n"
|
||||
"#extension GL_EXT_geometry_shader4 : enable\n"
|
||||
"uniform float u_anim1;\n"
|
||||
"varying in vec4 v_color[];\n"
|
||||
"varying out vec4 v_color_out;\n"
|
||||
"varying vec4 v_color;\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 v = gl_PositionIn[0];\n"
|
||||
" v_color_out = v + v_color[0];\n"
|
||||
" v_color = v;\n"
|
||||
"\n"
|
||||
" gl_Position = v + vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
||||
" gl_Position = v - vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
||||
@@ -106,10 +105,10 @@ static const char* fragSource = {
|
||||
"#version 120\n"
|
||||
"#extension GL_EXT_geometry_shader4 : enable\n"
|
||||
"uniform float u_anim1;\n"
|
||||
"varying vec4 v_color_out;\n"
|
||||
"varying vec4 v_color;\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" gl_FragColor = v_color_out;\n"
|
||||
" gl_FragColor = v_color;\n"
|
||||
"}\n"
|
||||
};
|
||||
|
||||
@@ -179,7 +178,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int main( int , char** )
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
osg::Geode* root( new osg::Geode );
|
||||
root->addDrawable( new SomePoints );
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
if (cv)
|
||||
{
|
||||
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
||||
matrix.preMultTranslate(osg::Vec3(eyePointLocal.x(),eyePointLocal.y(),0.0f));
|
||||
matrix.preMult(osg::Matrix::translate(eyePointLocal.x(),eyePointLocal.y(),0.0f));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
if (cv)
|
||||
{
|
||||
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
||||
matrix.postMultTranslate(osg::Vec3(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
|
||||
matrix.postMult(osg::Matrix::translate(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ struct SnapeImageHandler : public osgGA::GUIEventHandler
|
||||
_key(key),
|
||||
_snapImage(si) {}
|
||||
|
||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
|
||||
{
|
||||
if (ea.getHandled()) return false;
|
||||
|
||||
|
||||
@@ -31,94 +31,24 @@
|
||||
#include <osgDB/WriteFile>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// A simple demo demonstrating how to set on an animated texture using an osg::ImageSequence
|
||||
//
|
||||
|
||||
osg::StateSet* createState(osg::ArgumentParser& arguments)
|
||||
osg::StateSet* createState()
|
||||
{
|
||||
osg::ref_ptr<osg::ImageSequence> imageSequence = new osg::ImageSequence;
|
||||
|
||||
bool preLoad = true;
|
||||
|
||||
while (arguments.read("--page-and-discard"))
|
||||
{
|
||||
imageSequence->setMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES);
|
||||
preLoad = false;
|
||||
}
|
||||
|
||||
while (arguments.read("--page-and-retain"))
|
||||
{
|
||||
imageSequence->setMode(osg::ImageSequence::PAGE_AND_RETAIN_IMAGES);
|
||||
preLoad = false;
|
||||
}
|
||||
|
||||
while (arguments.read("--preload"))
|
||||
{
|
||||
imageSequence->setMode(osg::ImageSequence::PRE_LOAD_ALL_IMAGES);
|
||||
preLoad = true;
|
||||
}
|
||||
|
||||
double length = -1.0;
|
||||
while (arguments.read("--length",length)) {}
|
||||
|
||||
if (arguments.argc()>1)
|
||||
{
|
||||
for(int i=1; i<arguments.argc(); ++i)
|
||||
{
|
||||
if (preLoad)
|
||||
{
|
||||
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(arguments[i]);
|
||||
if (image.valid())
|
||||
{
|
||||
imageSequence->addImage(image.get());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
imageSequence->addImageFile(arguments[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (length>0.0)
|
||||
{
|
||||
imageSequence->setLength(length);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int maxNum = osg::maximum(imageSequence->getFileNames().size(),
|
||||
imageSequence->getImages().size());
|
||||
|
||||
imageSequence->setLength(float(maxNum)*0.1f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (length>0.0)
|
||||
{
|
||||
imageSequence->setLength(length);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageSequence->setLength(4.0);
|
||||
}
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png"));
|
||||
}
|
||||
|
||||
// start the image sequence playing
|
||||
imageSequence->play();
|
||||
imageSequence->setDuration(2.0);
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png"));
|
||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png"));
|
||||
|
||||
#if 1
|
||||
osg::Texture2D* texture = new osg::Texture2D;
|
||||
@@ -128,13 +58,18 @@ osg::StateSet* createState(osg::ArgumentParser& arguments)
|
||||
texture->setResizeNonPowerOfTwoHint(false);
|
||||
texture->setImage(imageSequence.get());
|
||||
//texture->setTextureSize(512,512);
|
||||
|
||||
//texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback);
|
||||
#else
|
||||
osg::TextureRectangle* texture = new osg::TextureRectangle;
|
||||
texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
|
||||
texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
|
||||
texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);
|
||||
// texture->setResizeNonPowerOfTwoHint(false);
|
||||
texture->setImage(imageSequence.get());
|
||||
//texture->setTextureSize(512,512);
|
||||
|
||||
//texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback);
|
||||
#endif
|
||||
|
||||
// create the StateSet to store the texture data
|
||||
@@ -145,192 +80,20 @@ osg::StateSet* createState(osg::ArgumentParser& arguments)
|
||||
return stateset;
|
||||
}
|
||||
|
||||
osg::Node* createModel(osg::ArgumentParser& arguments)
|
||||
osg::Node* createModel()
|
||||
{
|
||||
|
||||
// create the geometry of the model, just a simple 2d quad right now.
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
geode->addDrawable(osg::createTexturedQuadGeometry(osg::Vec3(0.0f,0.0f,0.0), osg::Vec3(1.0f,0.0f,0.0), osg::Vec3(0.0f,0.0f,1.0f)));
|
||||
|
||||
geode->setStateSet(createState(arguments));
|
||||
geode->setStateSet(createState());
|
||||
|
||||
return geode;
|
||||
|
||||
}
|
||||
|
||||
|
||||
osg::ImageStream* s_imageStream = 0;
|
||||
class MovieEventHandler : public osgGA::GUIEventHandler
|
||||
{
|
||||
public:
|
||||
|
||||
MovieEventHandler():_playToggle(true),_trackMouse(false) {}
|
||||
|
||||
void setMouseTracking(bool track) { _trackMouse = track; }
|
||||
bool getMouseTracking() const { return _trackMouse; }
|
||||
|
||||
void set(osg::Node* node);
|
||||
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv);
|
||||
|
||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||
|
||||
typedef std::vector< osg::observer_ptr<osg::ImageStream> > ImageStreamList;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~MovieEventHandler() {}
|
||||
|
||||
class FindImageStreamsVisitor : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
FindImageStreamsVisitor(ImageStreamList& imageStreamList):
|
||||
_imageStreamList(imageStreamList) {}
|
||||
|
||||
virtual void apply(osg::Geode& geode)
|
||||
{
|
||||
apply(geode.getStateSet());
|
||||
|
||||
for(unsigned int i=0;i<geode.getNumDrawables();++i)
|
||||
{
|
||||
apply(geode.getDrawable(i)->getStateSet());
|
||||
}
|
||||
|
||||
traverse(geode);
|
||||
}
|
||||
|
||||
virtual void apply(osg::Node& node)
|
||||
{
|
||||
apply(node.getStateSet());
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
inline void apply(osg::StateSet* stateset)
|
||||
{
|
||||
if (!stateset) return;
|
||||
|
||||
osg::StateAttribute* attr = stateset->getTextureAttribute(0,osg::StateAttribute::TEXTURE);
|
||||
if (attr)
|
||||
{
|
||||
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(attr);
|
||||
if (texture2D) apply(dynamic_cast<osg::ImageStream*>(texture2D->getImage()));
|
||||
|
||||
osg::TextureRectangle* textureRec = dynamic_cast<osg::TextureRectangle*>(attr);
|
||||
if (textureRec) apply(dynamic_cast<osg::ImageStream*>(textureRec->getImage()));
|
||||
}
|
||||
}
|
||||
|
||||
inline void apply(osg::ImageStream* imagestream)
|
||||
{
|
||||
if (imagestream)
|
||||
{
|
||||
_imageStreamList.push_back(imagestream);
|
||||
s_imageStream = imagestream;
|
||||
}
|
||||
}
|
||||
|
||||
ImageStreamList& _imageStreamList;
|
||||
|
||||
protected:
|
||||
|
||||
FindImageStreamsVisitor& operator = (const FindImageStreamsVisitor&) { return *this; }
|
||||
};
|
||||
|
||||
|
||||
bool _playToggle;
|
||||
bool _trackMouse;
|
||||
ImageStreamList _imageStreamList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void MovieEventHandler::set(osg::Node* node)
|
||||
{
|
||||
_imageStreamList.clear();
|
||||
if (node)
|
||||
{
|
||||
FindImageStreamsVisitor fisv(_imageStreamList);
|
||||
node->accept(fisv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
|
||||
{
|
||||
switch(ea.getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||
{
|
||||
if (ea.getKey()=='p')
|
||||
{
|
||||
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||
itr!=_imageStreamList.end();
|
||||
++itr)
|
||||
{
|
||||
if ((*itr)->getStatus()==osg::ImageStream::PLAYING)
|
||||
{
|
||||
// playing, so pause
|
||||
std::cout<<"Pause"<<std::endl;
|
||||
(*itr)->pause();
|
||||
}
|
||||
else
|
||||
{
|
||||
// playing, so pause
|
||||
std::cout<<"Play"<<std::endl;
|
||||
(*itr)->play();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (ea.getKey()=='r')
|
||||
{
|
||||
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||
itr!=_imageStreamList.end();
|
||||
++itr)
|
||||
{
|
||||
std::cout<<"Restart"<<std::endl;
|
||||
(*itr)->rewind();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (ea.getKey()=='L')
|
||||
{
|
||||
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||
itr!=_imageStreamList.end();
|
||||
++itr)
|
||||
{
|
||||
if ( (*itr)->getLoopingMode() == osg::ImageStream::LOOPING)
|
||||
{
|
||||
std::cout<<"Toggle Looping Off"<<std::endl;
|
||||
(*itr)->setLoopingMode( osg::ImageStream::NO_LOOPING );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"Toggle Looping On"<<std::endl;
|
||||
(*itr)->setLoopingMode( osg::ImageStream::LOOPING );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void MovieEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
||||
{
|
||||
usage.addKeyboardMouseBinding("p","Play/Pause movie");
|
||||
usage.addKeyboardMouseBinding("r","Restart movie");
|
||||
usage.addKeyboardMouseBinding("l","Toggle looping of movie");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
@@ -338,20 +101,11 @@ int main(int argc, char **argv)
|
||||
// construct the viewer.
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
std::string filename;
|
||||
arguments.read("-o",filename);
|
||||
|
||||
// create a model from the images and pass it to the viewer.
|
||||
viewer.setSceneData(createModel(arguments));
|
||||
viewer.setSceneData(createModel());
|
||||
|
||||
// pass the model to the MovieEventHandler so it can pick out ImageStream's to manipulate.
|
||||
MovieEventHandler* meh = new MovieEventHandler();
|
||||
meh->set( viewer.getSceneData() );
|
||||
viewer.addEventHandler( meh );
|
||||
|
||||
viewer.addEventHandler( new osgViewer::StatsHandler());
|
||||
|
||||
if (!filename.empty())
|
||||
std::string filename;
|
||||
if (arguments.read("-o",filename))
|
||||
{
|
||||
osgDB::writeNodeFile(*viewer.getSceneData(),filename);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user