Changeset 73
- Timestamp:
- 4.11.2009 09:26:24 (3 weeks ago)
- Location:
- SoTerrain
- Files:
-
- 12 added
- 11 modified
- 2 moved
-
Makefile.am (modified) (4 diffs)
-
README (modified) (1 diff)
-
configure.ac (modified) (4 diffs)
-
include/data/Makefile.am (modified) (1 diff)
-
include/data/SbImageTile.h (moved) (moved from SoTerrain/include/data/SbTexture2Tile.h) (5 diffs)
-
include/data/SoHTTPTileCache.h (added)
-
include/data/SoImageTileCache.h (added)
-
include/data/SoTMSTileCache.h (added)
-
include/data/SoTexture2TileCache.h (modified) (1 diff)
-
include/data/SoTileCache.h (modified) (1 diff)
-
include/image (added)
-
include/image/Makefile.am (added)
-
include/image/SbImageLoader.h (added)
-
m4/soterrain.m4 (modified) (2 diffs)
-
src/SoTerrain.cpp (modified) (2 diffs)
-
src/data/Makefile.am (modified) (1 diff)
-
src/data/SbImageTile.cpp (moved) (moved from SoTerrain/src/data/SbTexture2Tile.cpp) (6 diffs)
-
src/data/SoHTTPTileCache.cpp (added)
-
src/data/SoImageTileCache.cpp (added)
-
src/data/SoTMSTileCache.cpp (added)
-
src/data/SoTexture2TileCache.cpp (modified) (2 diffs)
-
src/image (added)
-
src/image/Makefile.am (added)
-
src/image/SbImageLoader.cpp (added)
-
src/test/SoTileCacheTest.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
SoTerrain/Makefile.am
r62 r73 9 9 src/general/libSoTerrainGeneral.la \ 10 10 src/geomipmapping/libSoTerrainGeoMipMapping.la \ 11 src/image/libSoTerrainImage.la \ 11 12 src/chunkedlod/libSoTerrainChunkedLoD.la \ 12 13 src/roam/libSoTerrainROAM.la … … 25 26 include/geomipmapping \ 26 27 include/gui \ 28 include/image \ 27 29 include/chunkedlod \ 28 30 include/profiler \ … … 33 35 src/geomipmapping \ 34 36 src/gui \ 37 src/image \ 35 38 src/chunkedlod \ 36 39 src/profiler \ … … 75 78 endif 76 79 77 doc : 80 doc : Doxyfile 78 81 doxygen Doxyfile 79 82 touch Doxyfile -
SoTerrain/README
r43 r73 1 DEPENDENCIES: 1 2 3 automake 4 autoconf 5 autoconf-archive 6 Coin 7 SoQt 8 Qt 9 10 OPTIONAL DEPENDENCIES: 11 12 simage 13 -
SoTerrain/configure.ac
r62 r73 67 67 AC_SUBST([SIMAGE_PATH]) 68 68 69 # Check for CURL. 70 AX_LIB_CURL([7.15.0], 71 [ac_have_curl=yes], 72 [ac_have_curl=no; AC_MSG_ERROR([Your system lacks of libcurl >= 7.15.0])]) 73 CXXFLAGS="$CXXFLAGS $CURL_CFLAGS" 74 LDFLAGS="$LDFLAGS $CURL_LIBS" 75 69 76 # Check for soqt-config. 70 77 AC_CHECK_FILE([$SOQT_PATH/bin/soqt-config], 71 [], 72 [AC_MSG_FAILURE([soqt-config not found. Try to specify correct path to SoQt libary using --with-soqt=<soqt_path> option.])]) 78 [ac_have_soqt=yes], 79 [ac_have_simage=no; AC_MSG_FAILURE([soqt-config not found. Try to specify correct path to SoQt libary using --with-soqt=<soqt_path> option.])]) 80 CXXFLAGS="$CXXFLAGS `$SOQT_PATH/bin/soqt-config --cppflags` -I`pwd`/include/ -Wall -Wno-long-long -ansi" 81 LDFLAGS="$LDFLAGS `$SOQT_PATH/bin/soqt-config --ldflags` `$SOQT_PATH/bin/soqt-config --libs`" 73 82 74 83 # Check for simage-config. … … 76 85 [ac_have_simage=yes], 77 86 [ac_have_simage=no; AC_MSG_WARN([simage-config not found. Try to specify correct path to simage libary using --with-simage=<simage_path> option.])]) 78 79 # Set building variables.80 CXXFLAGS="`$SOQT_PATH/bin/soqt-config --cppflags` -I`pwd`/include/ -Wall -Wno-long-long -ansi"81 LDFLAGS="`$SOQT_PATH/bin/soqt-config --ldflags` `$SOQT_PATH/bin/soqt-config --libs`"82 83 87 if test x"$ac_have_simage" = "xyes"; 84 88 then … … 133 137 include/geomipmapping/Makefile 134 138 include/gui/Makefile 139 include/image/Makefile 135 140 include/chunkedlod/Makefile 136 141 include/profiler/Makefile … … 141 146 src/geomipmapping/Makefile 142 147 src/gui/Makefile 148 src/image/Makefile 143 149 src/chunkedlod/Makefile 144 150 src/profiler/Makefile -
SoTerrain/include/data/Makefile.am
r59 r73 2 2 3 3 libSoTerrain_la_HEADERS = SbTile.h \ 4 SbImageTile.h \ 4 5 SoTileCache.h \ 5 6 SoTileCacheElement.h \ 6 SbTexture2Tile.h \ 7 SoTexture2TileCache.h 7 SoTexture2TileCache.h \ 8 SoImageTileCache.h \ 9 SoHTTPTileCache.h \ 10 SoTMSTileCache.h -
SoTerrain/include/data/SbImageTile.h
r72 r73 1 #ifndef SB_ TEXTURE2_TILE2 #define SB_ TEXTURE2_TILE1 #ifndef SB_IMAGE_TILE 2 #define SB_IMAGE_TILE 3 3 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 // SoTerrain 6 6 /////////////////////////////////////////////////////////////////////////////// 7 /// \copybrief Sb Texture2Tile7 /// \copybrief SbImageTile 8 8 /// \file 9 9 /// \author Radek Barton (blackhex@post.cz) 10 10 /// \date <br>Created: 2009/06/25<br>Modified: 2009/06/25 11 11 /// 12 /// \copydetails Sb Texture2Tile12 /// \copydetails SbImageTile 13 13 ////////////////////////////////////////////////////////////////////////////// 14 14 // Copyright (C) 2009 Radek Barton … … 34 34 #include <SoTerrain/data/SbTile.h> 35 35 36 struct Sb Texture2Tile : SbTile36 struct SbImageTile : SbTile 37 37 { 38 38 public: … … 41 41 /** 42 42 */ 43 Sb Texture2Tile(const int32_t offsetX, const int32_t offsetY, const int32_t43 SbImageTile(const int32_t offsetX, const int32_t offsetY, const int32_t 44 44 width, const int32_t height, const int32_t lineWidth, const unsigned 45 45 char * data); … … 47 47 /** 48 48 */ 49 ~Sb Texture2Tile();49 ~SbImageTile(); 50 50 51 51 /* Virtual methods. */ … … 80 80 }; 81 81 82 #endif // SB_ TEXTURE2_TILE82 #endif // SB_IMAGE_TILE -
SoTerrain/include/data/SoTexture2TileCache.h
r59 r73 68 68 /** 69 69 */ 70 v oid doAction(SoAction * action);70 virtual void doAction(SoAction * action); 71 71 72 72 /** -
SoTerrain/include/data/SoTileCache.h
r59 r73 61 61 62 62 /* Fields. */ 63 63 64 /// TODO 64 65 SoSFInt32 minResolution; -
SoTerrain/m4/soterrain.m4
r62 r73 1 1 # AM_PROG_MOC([MINIMUM-VERSION]) 2 # -------------------------------- 2 # ------------------------------------------------------------------------------ 3 3 AC_DEFUN([AM_PROG_MOC], 4 4 [AC_PATH_PROG([MOC], … … 18 18 [AC_MSG_RESULT([no]) 19 19 AC_MSG_ERROR([MOC version $1 not found.])])]) 20 21 # AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG]) 22 # ------------------------------------------------------------------------------ 23 AU_ALIAS([AC_PATH_GENERIC], [AX_PATH_GENERIC]) 24 AC_DEFUN([AX_PATH_GENERIC],[ 25 AC_REQUIRE([AC_PROG_SED]) 26 27 dnl we're going to need uppercase and lowercase versions of the 28 dnl string `LIBRARY' 29 pushdef([UP], translit([$1], [a-z], [A-Z]))dnl 30 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl 31 32 AC_ARG_WITH(DOWN-prefix,[AS_HELP_STRING([--with-]DOWN[-prefix=PREFIX], [Prefix where $1 is installed (optional)])], 33 DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") 34 AC_ARG_WITH(DOWN-exec-prefix,[AS_HELP_STRING([--with-]DOWN[-exec-prefix=EPREFIX], [Exec prefix where $1 is installed (optional)])], 35 DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") 36 37 AC_ARG_VAR(UP[]_CONFIG, [config script used for $1]) 38 AC_ARG_VAR(UP[]_CFLAGS, [CFLAGS used for $1]) 39 AC_ARG_VAR(UP[]_LIBS, [LIBS used for $1]) 40 41 AS_IF([test x$DOWN[]_config_exec_prefix != x],[ 42 DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" 43 AS_IF([test x${UP[]_CONFIG+set} != xset],[ 44 UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config 45 ]) 46 ]) 47 AS_IF([test x$DOWN[]_config_prefix != x],[ 48 DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" 49 AS_IF([test x${UP[]_CONFIG+set} != xset],[ 50 UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config 51 ]) 52 ]) 53 54 AC_PATH_PROGS(UP[]_CONFIG,[$6 DOWN-config],[no]) 55 AS_IF([test "$UP[]_CONFIG" == "no"],[ 56 : 57 $5 58 ],[ 59 dnl Get the CFLAGS from LIBRARY-config script 60 AS_IF([test x"$7" == x],[ 61 UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" 62 ],[ 63 UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args $7`" 64 ]) 65 66 dnl Get the LIBS from LIBRARY-config script 67 AS_IF([test x"$8" == x],[ 68 UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" 69 ],[ 70 UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args $8`" 71 ]) 72 73 AS_IF([test x"$2" != x],[ 74 dnl Check for provided library version 75 AS_IF([test x"$3" != x],[ 76 dnl Use provided sed expression 77 DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e $3`" 78 ],[ 79 DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e 's/^\ *\(.*\)\ *$/\1/'`" 80 ]) 81 82 AC_MSG_CHECKING([for $1 ($DOWN[]_version) >= $2]) 83 AX_COMPARE_VERSION($DOWN[]_version,[ge],[$2],[ 84 AC_MSG_RESULT([yes]) 85 86 AC_SUBST(UP[]_CFLAGS) 87 AC_SUBST(UP[]_LIBS) 88 : 89 $4 90 ],[ 91 AC_MSG_RESULT([no]) 92 : 93 $5 94 ]) 95 ],[ 96 AC_SUBST(UP[]_CFLAGS) 97 AC_SUBST(UP[]_LIBS) 98 : 99 $4 100 ]) 101 ]) 102 103 popdef([UP]) 104 popdef([DOWN]) 105 ]) 106 107 # AX_LIB_CURL([VERSION],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) 108 # ------------------------------------------------------------------------------ 109 AU_ALIAS([AC_CHECK_CURL], [AX_LIB_CURL]) 110 AC_DEFUN([AX_LIB_CURL], 111 [AX_PATH_GENERIC([curl],[$1],'s/^libcurl\ \+//',[$2],[$3])]) -
SoTerrain/src/SoTerrain.cpp
r61 r73 29 29 #include <SoTerrain/data/SoTileCacheElement.h> 30 30 #include <SoTerrain/data/SoTexture2TileCache.h> 31 #include <SoTerrain/data/SoHTTPTileCache.h> 32 #include <SoTerrain/data/SoImageTileCache.h> 33 #include <SoTerrain/data/SoTMSTileCache.h> 31 34 #include <SoTerrain/geomipmapping/SoGeoMipmapTerrain.h> 32 35 #include <SoTerrain/profiler/SoProfileGroup.h> … … 43 46 SoTileCacheElement::initClass(); 44 47 SoTexture2TileCache::initClass(); 48 SoImageTileCache::initClass(); 49 SoHTTPTileCache::initClass(); 50 SoTMSTileCache::initClass(); 45 51 SoGeoMipmapTerrain::initClass(); 46 52 SoProfileGroup::initClass(); -
SoTerrain/src/data/Makefile.am
r59 r73 2 2 3 3 libSoTerrainData_la_SOURCES = SbTile.cpp \ 4 SbImageTile.cpp \ 4 5 SoTileCache.cpp \ 5 6 SoTileCacheElement.cpp \ 6 SbTexture2Tile.cpp \ 7 SoTexture2TileCache.cpp 7 SoTexture2TileCache.cpp \ 8 SoImageTileCache.cpp \ 9 SoHTTPTileCache.cpp \ 10 SoTMSTileCache.cpp -
SoTerrain/src/data/SbImageTile.cpp
r72 r73 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 /// \file 5 /// \copybrief include/data/Sb Texture2Tile.h6 /// \copydetails include/data/Sb Texture2Tile.h5 /// \copybrief include/data/SbImageTile.h 6 /// \copydetails include/data/SbImageTile.h 7 7 ////////////////////////////////////////////////////////////////////////////// 8 8 // Copyright (C) 2009 Radek Barton … … 34 34 // SoTerrain includes. 35 35 #include <SoTerrain/debug.h> 36 #include <SoTerrain/data/Sb Texture2Tile.h>36 #include <SoTerrain/data/SbImageTile.h> 37 37 38 38 /****************************************************************************** 39 * Sb Texture2Tile - public39 * SbImageTile - public 40 40 ******************************************************************************/ 41 41 42 Sb Texture2Tile::SbTexture2Tile(const int32_t _offsetX, const int32_t _offsetY,42 SbImageTile::SbImageTile(const int32_t _offsetX, const int32_t _offsetY, 43 43 const int32_t width, const int32_t height, const int32_t _lineWidth, const 44 44 unsigned char * _data): … … 49 49 } 50 50 51 Sb Texture2Tile::~SbTexture2Tile()51 SbImageTile::~SbImageTile() 52 52 { 53 53 // Nothing. 54 54 } 55 55 56 unsigned char Sb Texture2Tile::get(const int32_t x, const int32_t y) const56 unsigned char SbImageTile::get(const int32_t x, const int32_t y) const 57 57 { 58 58 assert(this->data); … … 61 61 } 62 62 63 void Sb Texture2Tile::GLRender()63 void SbImageTile::GLRender() 64 64 { 65 65 assert(this->data); … … 80 80 } 81 81 82 SbBox3f Sb Texture2Tile::computeBBox()82 SbBox3f SbImageTile::computeBBox() 83 83 { 84 84 assert(this->data); … … 100 100 101 101 /****************************************************************************** 102 * Sb Texture2Tile - protected102 * SbImageTile - protected 103 103 ******************************************************************************/ 104 104 105 105 /****************************************************************************** 106 * Sb Texture2Tile - private106 * SbImageTile - private 107 107 ******************************************************************************/ -
SoTerrain/src/data/SoTexture2TileCache.cpp
r72 r73 30 30 // Local includes. 31 31 #include <SoTerrain/SbUtils.h> 32 #include <SoTerrain/data/Sb Texture2Tile.h>32 #include <SoTerrain/data/SbImageTile.h> 33 33 #include <SoTerrain/data/SoTexture2TileCache.h> 34 34 #include <SoTerrain/data/SoTileCacheElement.h> … … 67 67 68 68 // Directly return the tile. 69 return new Sb Texture2Tile(x, y, width, height, this->width, this->data);69 return new SbImageTile(x, y, width, height, this->width, this->data); 70 70 } 71 71 -
SoTerrain/src/test/SoTileCacheTest.cpp
r61 r73 41 41 42 42 // SoTerrain includes. 43 #include <SoTerrain/SoTerrain.h> 43 44 #include <SoTerrain/general/SoGeometryTexture2.h> 44 45 #include <SoTerrain/data/SoTexture2TileCache.h> 46 #include <SoTerrain/data/SoTMSTileCache.h> 45 47 #include <SoTerrain/data/SoTileCacheElement.h> 46 48 … … 53 55 #endif 54 56 57 enum cache_type_t 58 { 59 TEXTURE2, 60 TMS 61 }; 62 63 cache_type_t cache_type = TEXTURE2; 64 55 65 /** */ 56 66 void help() 57 67 { 58 std::cout << "Usage: SoTileCacheTest " << std::endl;68 std::cout << "Usage: SoTileCacheTest [-c (texture2 | tms)]" << std::endl; 59 69 } 60 70 … … 66 76 // Get program arguments. 67 77 int command = 0; 68 while ((command = getopt(argc, argv, " ")) != -1)78 while ((command = getopt(argc, argv, "c:")) != -1) 69 79 { 70 80 switch (command) 71 81 { 82 case 'c': 83 { 84 if (!strcmp(optarg, "tms")) 85 { 86 cache_type = TMS; 87 } 88 else 89 { 90 cache_type = TEXTURE2; 91 } 92 } 93 break; 72 94 case '?': 73 95 { … … 93 115 94 116 // Initialization of custom Inventor classes. 95 SoTileCacheElement::initClass(); 96 SoTileCache::initClass(); 97 SoGeometryTexture2::initClass(); 98 SoTexture2TileCache::initClass(); 117 SoTerrain::init(argc, argv); 99 118 SoDummyTileCacheUser::initClass(); 100 119 … … 105 124 SoDrawStyle * draw_style = new SoDrawStyle(); 106 125 SoGeometryTexture2 * heightmap = new SoGeometryTexture2(); 107 SoT exture2TileCache * tile_cache = new SoTexture2TileCache();126 SoTileCache * tile_cache = NULL; 108 127 SoDummyTileCacheUser * tile_cache_user = new SoDummyTileCacheUser(); 128 129 switch (cache_type) 130 { 131 case TEXTURE2: 132 { 133 tile_cache = new SoTexture2TileCache(); 134 } 135 break; 136 case TMS: 137 { 138 tile_cache = new SoTMSTileCache(); 139 } 140 break; 141 } 109 142 110 143 // Set scene graph nodes properties.
