diff --git a/README.md b/README.md index fa7958d6..74fd1929 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,7 @@ OctoMap - A probabilistic, flexible, and compact 3D mapping library for robotic Authors: Kai M. Wurm and Armin Hornung, University of Freiburg, Copyright (C) 2009-2013. http://octomap.github.com -Further Contributors: -* C. Sprunk, University of Freiburg -* J. Mueller, University of Freiburg -* S. Osswald, University of Freiburg -* R. Schmitt, University of Freiburg -* R. Bogdan Rusu, Willow Garage Inc. -* C. Dornhege, University of Freiburg +See the [list of contributors](octomap/AUTHORS.txt) for further authors. License: * octomap: [New BSD License](octomap/LICENSE.txt) diff --git a/dynamicEDT3D/dynamicEDT3DConfig.cmake.in b/dynamicEDT3D/dynamicEDT3DConfig.cmake.in index a6a043e6..c8486b58 100644 --- a/dynamicEDT3D/dynamicEDT3DConfig.cmake.in +++ b/dynamicEDT3D/dynamicEDT3DConfig.cmake.in @@ -6,12 +6,10 @@ # OCTOMAP_LIBRARIES - libraries to link against # Tell the user project where to find our headers and libraries -set(DYNAMICEDT3D_INCLUDE_DIRS @DYNAMICEDT3D_INCLUDE_DIRS@) -set(DYNAMICEDT3D_LIBRARY_DIRS @DYNAMICEDT3D_LIB_DIR@) +set(DYNAMICEDT3D_INCLUDE_DIRS "@DYNAMICEDT3D_INCLUDE_DIRS@") +set(DYNAMICEDT3D_LIBRARY_DIRS "@DYNAMICEDT3D_LIB_DIR@") # Our library dependencies (contains definitions for IMPORTED targets) # include("@FOOBAR_CMAKE_DIR@/FooBarLibraryDepends.cmake") set(DYNAMICEDT3D_LIBRARIES dynamicedt3d) - -#set(FOOBAR_EXECUTABLE bar) \ No newline at end of file diff --git a/octomap/AUTHORS.txt b/octomap/AUTHORS.txt new file mode 100644 index 00000000..30560c84 --- /dev/null +++ b/octomap/AUTHORS.txt @@ -0,0 +1,12 @@ +OctoMap was originally developed by Kai M. Wurm and Armin Hornung, +University of Freiburg + +Further contributors: +* C. Sprunk, University of Freiburg +* J. Mueller, University of Freiburg +* S. Osswald, University of Freiburg +* R. Schmitt, University of Freiburg +* R. Bogdan Rusu, Willow Garage Inc. +* C. Dornhege, University of Freiburg +* F-M. de Rainville, Universite Laval Quebec +* B. Jensen, TU Munich \ No newline at end of file diff --git a/octomap/CHANGELOG.txt b/octomap/CHANGELOG.txt index 49e57e4b..74eb3f39 100644 --- a/octomap/CHANGELOG.txt +++ b/octomap/CHANGELOG.txt @@ -1,3 +1,15 @@ +v1.6.2: 2013-11-26 +================== +- Improved OSX 10.9 compatibility (thx to B. Jensen) +- Improved VC++ compatibility (thx to tmdiv) +- New fct. getRayIntersection to get real intersection of raycasting on + voxel (thanks to F-M. de Rainville) +- Fix #54: Quote paths in CMake configs to avoid problems with spaces +- Fix #53: Auto-pruning after updateNode +- Fix #44: CMAKE_SHARED_LIBRARY_SUFFIX in CMakeConfig (Win / Mac compatibility) +- octovis now includes QGLViewer 2.4 (Qt5 support) +- octovis now looks for the octomap version of the same number + v1.6.1: 2013-06-19 ================== - New function swapContent to exchange the contents of two octrees (issue #32) diff --git a/octomap/CMakeLists.txt b/octomap/CMakeLists.txt index 7e7a20fd..85e3f910 100644 --- a/octomap/CMakeLists.txt +++ b/octomap/CMakeLists.txt @@ -6,7 +6,7 @@ ENABLE_TESTING() # version (e.g. for packaging) set(OCTOMAP_MAJOR_VERSION 1) set(OCTOMAP_MINOR_VERSION 6) -set(OCTOMAP_PATCH_VERSION 1) +set(OCTOMAP_PATCH_VERSION 2) set(OCTOMAP_VERSION ${OCTOMAP_MAJOR_VERSION}.${OCTOMAP_MINOR_VERSION}.${OCTOMAP_PATCH_VERSION}) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) diff --git a/octomap/README.md b/octomap/README.md index 3a519ef5..a27c3d23 100644 --- a/octomap/README.md +++ b/octomap/README.md @@ -4,13 +4,7 @@ Octomap - A probabilistic, flexible, and compact 3D mapping library for robotic Authors: Kai M. Wurm and Armin Hornung, University of Freiburg, Copyright (C) 2009-2013. http://octomap.github.com -Further Contributors: -* C. Sprunk, University of Freiburg -* J. Mueller, University of Freiburg -* S. Osswald, University of Freiburg -* R. Schmitt, University of Freiburg -* R. Bogdan Rusu, Willow Garage Inc. -* C. Dornhege, University of Freiburg +See the [list of contributors](AUTHORS.txt) for further authors. License for octomap: [New BSD License](LICENSE.txt) diff --git a/octomap/include/octomap/AbstractOccupancyOcTree.h b/octomap/include/octomap/AbstractOccupancyOcTree.h index 35b6b422..c81c64c4 100644 --- a/octomap/include/octomap/AbstractOccupancyOcTree.h +++ b/octomap/include/octomap/AbstractOccupancyOcTree.h @@ -186,9 +186,9 @@ namespace octomap { /// sets the threshold for occupancy (sensor model) void setOccupancyThres(double prob){occ_prob_thres_log = logodds(prob); } - /// sets the probablility for a "hit" (will be converted to logodds) - sensor model + /// sets the probability for a "hit" (will be converted to logodds) - sensor model void setProbHit(double prob){prob_hit_log = logodds(prob); assert(prob_hit_log >= 0.0);} - /// sets the probablility for a "miss" (will be converted to logodds) - sensor model + /// sets the probability for a "miss" (will be converted to logodds) - sensor model void setProbMiss(double prob){prob_miss_log = logodds(prob); assert(prob_miss_log <= 0.0);} /// sets the minimum threshold for occupancy clamping (sensor model) void setClampingThresMin(double thresProb){clamping_thres_min = logodds(thresProb); } @@ -200,13 +200,13 @@ namespace octomap { /// @return threshold (logodds) for occupancy - sensor model float getOccupancyThresLog() const {return occ_prob_thres_log; } - /// @return probablility for a "hit" in the sensor model (probability) + /// @return probability for a "hit" in the sensor model (probability) double getProbHit() const {return probability(prob_hit_log); } - /// @return probablility for a "hit" in the sensor model (logodds) + /// @return probability for a "hit" in the sensor model (logodds) float getProbHitLog() const {return prob_hit_log; } - /// @return probablility for a "miss" in the sensor model (probability) + /// @return probability for a "miss" in the sensor model (probability) double getProbMiss() const {return probability(prob_miss_log); } - /// @return probablility for a "miss" in the sensor model (logodds) + /// @return probability for a "miss" in the sensor model (logodds) float getProbMissLog() const {return prob_miss_log; } /// @return minimum threshold for occupancy clamping in the sensor model (probability) diff --git a/octomap/include/octomap/OcTreeKey.h b/octomap/include/octomap/OcTreeKey.h index 37e64209..d582a58c 100644 --- a/octomap/include/octomap/OcTreeKey.h +++ b/octomap/include/octomap/OcTreeKey.h @@ -34,15 +34,29 @@ #ifndef OCTOMAP_OCTREE_KEY_H #define OCTOMAP_OCTREE_KEY_H +/* According to c++ standard including this header has no practical effect + * but it can be used to determine the c++ standard library implementation. + */ +#include #include -#ifdef __GNUC__ + +/* Libc++ does not implement the TR1 namespace, all c++11 related functionality + * is instead implemented in the std namespace. + */ +#if defined(__GNUC__) && ! defined(_LIBCPP_VERSION) #include - #include -#else + #include + namespace octomap { + namespace unordered_ns = std::tr1; + }; +#else #include - #include -#endif + #include + namespace octomap { + namespace unordered_ns = std; + } +#endif namespace octomap { @@ -95,14 +109,14 @@ namespace octomap { * @note you need to use boost::unordered_set instead if your compiler does not * yet support tr1! */ - typedef std::tr1::unordered_set KeySet; + typedef unordered_ns::unordered_set KeySet; /** * Data structrure to efficiently track changed nodes as a combination of * OcTreeKeys and a bool flag (to denote newly created nodes) * */ - typedef std::tr1::unordered_map KeyBoolMap; + typedef unordered_ns::unordered_map KeyBoolMap; class KeyRay { diff --git a/octomap/include/octomap/OccupancyOcTreeBase.h b/octomap/include/octomap/OccupancyOcTreeBase.h index 5d1c41de..99bf2f09 100644 --- a/octomap/include/octomap/OccupancyOcTreeBase.h +++ b/octomap/include/octomap/OccupancyOcTreeBase.h @@ -279,6 +279,20 @@ namespace octomap { virtual bool castRay(const point3d& origin, const point3d& direction, point3d& end, bool ignoreUnknownCells=false, double maxRange=-1.0) const; + /** + * Retrieves the entry point of a ray into a voxel. This is the closest intersection point of the ray + * originating from origin and a plane of the axis aligned cube. + * + * @param[in] origin Starting point of ray + * @param[in] direction A vector pointing in the direction of the raycast. Does not need to be normalized. + * @param[in] center The center of the voxel where the ray terminated. This is the output of castRay. + * @param[out] intersection The entry point of the ray into the voxel, on the voxel surface. + * @param[in] delta A small increment to avoid ambiguity of beeing exactly on a voxel surface. A positive value will get the point out of the hit voxel, while a negative valuewill get it inside. + * @return Whether or not an intesection point has been found. Either, the ray never cross the voxel or the ray is exactly parallel to the only surface it intersect. + */ + virtual bool getRayIntersection(const point3d& origin, const point3d& direction, const point3d& center, + point3d& intersection, double delta=0.0) const; + /** * Performs a step of the marching cubes surface reconstruction algorithm * to retreive the normal of the triangles that fall in the cube @@ -394,7 +408,7 @@ namespace octomap { virtual void integrateHit(NODE* occupancyNode) const; /// integrate a "miss" measurement according to the tree's sensor model virtual void integrateMiss(NODE* occupancyNode) const; - // update logodds value of node, given update is added to current value. + /// update logodds value of node by adding to the current value. virtual void updateNodeLogOdds(NODE* occupancyNode, const float& update) const; /// converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" diff --git a/octomap/include/octomap/OccupancyOcTreeBase.hxx b/octomap/include/octomap/OccupancyOcTreeBase.hxx index 9e6eb10d..1fc1f850 100644 --- a/octomap/include/octomap/OccupancyOcTreeBase.hxx +++ b/octomap/include/octomap/OccupancyOcTreeBase.hxx @@ -340,10 +340,13 @@ namespace octomap { NODE* retval = updateNodeRecurs(node->getChild(pos), created_node, key, depth+1, log_odds_update, lazy_eval); // prune node if possible, otherwise set own probability // note: combining both did not lead to a speedup! - if (node->pruneNode()) + if (node->pruneNode()){ this->tree_size -= 8; - else + // return pointer to current parent (pruned), the just updated node no longer exists + retval = node; + } else{ node->updateOccupancyChildren(); + } return retval; } @@ -626,6 +629,94 @@ namespace octomap { return true; } + template + bool OccupancyOcTreeBase::getRayIntersection (const point3d& origin, const point3d& direction, const point3d& center, + point3d& intersection, double delta/*=0.0*/) const { + // We only need three normals for the six planes + octomap::point3d normalX(1, 0, 0); + octomap::point3d normalY(0, 1, 0); + octomap::point3d normalZ(0, 0, 1); + + // One point on each plane, let them be the center for simplicity + octomap::point3d pointXNeg(center(0) - this->resolution / 2.0, center(1), center(2)); + octomap::point3d pointXPos(center(0) + this->resolution / 2.0, center(1), center(2)); + octomap::point3d pointYNeg(center(0), center(1) - this->resolution / 2.0, center(2)); + octomap::point3d pointYPos(center(0), center(1) + this->resolution / 2.0, center(2)); + octomap::point3d pointZNeg(center(0), center(1), center(2) - this->resolution / 2.0); + octomap::point3d pointZPos(center(0), center(1), center(2) + this->resolution / 2.0); + + double lineDotNormal = 0.0; + double d = 0.0; + double outD = std::numeric_limits::max(); + octomap::point3d intersect; + bool found = false; + + // Find the intersection (if any) with each place + // Line dot normal will be zero if they are parallel, in which case no intersection can be the entry one + // if there is an intersection does it occur in the bounded plane of the voxel + // if yes keep only the closest (smallest distance to sensor origin). + if((lineDotNormal = normalX.dot(direction))){ + d = (pointXNeg - origin).dot(normalX) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(1) < (pointYNeg(1) - 1e-6) || intersect(1) > (pointYPos(1) + 1e-6) || + intersect(2) < (pointZNeg(2) - 1e-6) || intersect(2) > (pointZPos(2) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + + d = (pointXPos - origin).dot(normalX) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(1) < (pointYNeg(1) - 1e-6) || intersect(1) > (pointYPos(1) + 1e-6) || + intersect(2) < (pointZNeg(2) - 1e-6) || intersect(2) > (pointZPos(2) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + } + + if((lineDotNormal = normalY.dot(direction))){ + d = (pointYNeg - origin).dot(normalY) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || + intersect(2) < (pointZNeg(2) - 1e-6) || intersect(2) > (pointZPos(2) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + + d = (pointYPos - origin).dot(normalY) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || + intersect(2) < (pointZNeg(2) - 1e-6) || intersect(2) > (pointZPos(2) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + } + + if((lineDotNormal = normalZ.dot(direction))){ + d = (pointZNeg - origin).dot(normalZ) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || + intersect(1) < (pointYNeg(1) - 1e-6) || intersect(1) > (pointYPos(1) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + + d = (pointZPos - origin).dot(normalZ) / lineDotNormal; + intersect = direction * d + origin; + if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || + intersect(1) < (pointYNeg(1) - 1e-6) || intersect(1) > (pointYPos(1) + 1e-6))){ + outD = std::min(outD, d); + found = true; + } + } + + // Substract (add) a fraction to ensure no ambiguity on the starting voxel + // Don't start on a bondary. + if(found) + intersection = direction * (outD + delta) + origin; + + return found; + } + template inline bool OccupancyOcTreeBase::integrateMissOnRay(const point3d& origin, const point3d& end, bool lazy_eval) { diff --git a/octomap/octomap-config.cmake.in b/octomap/octomap-config.cmake.in index 64b7d7c7..6b0fd785 100644 --- a/octomap/octomap-config.cmake.in +++ b/octomap/octomap-config.cmake.in @@ -21,18 +21,12 @@ # =================================================================================== -set(OCTOMAP_INCLUDE_DIRS @OCTOMAP_INCLUDE_DIRS@) -set(OCTOMAP_LIBRARY_DIRS @OCTOMAP_LIB_DIR@) +set(OCTOMAP_INCLUDE_DIRS "@OCTOMAP_INCLUDE_DIRS@") +set(OCTOMAP_LIBRARY_DIRS "@OCTOMAP_LIB_DIR@") -# library ext. hardcoded to dylib on Apple -if(APPLE) - set(SO_EXT ".dylib") -else(APPLE) - set(SO_EXT ".so") -endif(APPLE) # Set library names as absolute paths: set(OCTOMAP_LIBRARIES - @OCTOMAP_LIB_DIR@/liboctomap${SO_EXT} - @OCTOMAP_LIB_DIR@/liboctomath${SO_EXT} + "@OCTOMAP_LIB_DIR@/liboctomap@CMAKE_SHARED_LIBRARY_SUFFIX@" + "@OCTOMAP_LIB_DIR@/liboctomath@CMAKE_SHARED_LIBRARY_SUFFIX@" ) \ No newline at end of file diff --git a/octomap/package.xml b/octomap/package.xml index d5ee6d3d..a3467301 100644 --- a/octomap/package.xml +++ b/octomap/package.xml @@ -1,6 +1,6 @@ octomap - 1.6.1 + 1.6.2 The OctoMap library implements a 3D occupancy grid mapping approach, providing data structures and mapping algorithms in C++. The map implementation is based on an octree. See http://octomap.github.io for details. diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt index be96125b..69854fcd 100644 --- a/octomap/src/CMakeLists.txt +++ b/octomap/src/CMakeLists.txt @@ -50,6 +50,9 @@ TARGET_LINK_LIBRARIES(simple_example octomap) ADD_EXECUTABLE(normals_example normals_example.cpp) TARGET_LINK_LIBRARIES(normals_example octomap) +ADD_EXECUTABLE(intersection_example intersection_example.cpp) +TARGET_LINK_LIBRARIES(intersection_example octomap) + # installation: # store all header files to install: diff --git a/octomap/src/Pointcloud.cpp b/octomap/src/Pointcloud.cpp index 30639d29..bb6215c6 100644 --- a/octomap/src/Pointcloud.cpp +++ b/octomap/src/Pointcloud.cpp @@ -31,11 +31,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef _MSC_VER +/* According to c++ standard including this header has no practical effect + * but it can be used to determine the c++ standard library implementation. + */ +#include + +#if defined(_MSC_VER) || defined(_LIBCPP_VERSION) #include -#else - #include -#endif +#else + #include +#endif #include #include @@ -199,13 +204,13 @@ namespace octomap { void Pointcloud::subSampleRandom(unsigned int num_samples, Pointcloud& sample_cloud) { point3d_collection samples; - // visual studio does not support random_sample_n - #ifdef _MSC_VER - samples.reserve(this->size()); - samples.insert(samples.end(), this->begin(), this->end()); - std::random_shuffle(samples.begin(), samples.end()); - samples.resize(num_samples); - #else + // visual studio does not support random_sample_n and neither does libc++ + #if defined(_MSC_VER) || defined(_LIBCPP_VERSION) + samples.reserve(this->size()); + samples.insert(samples.end(), this->begin(), this->end()); + std::random_shuffle(samples.begin(), samples.end()); + samples.resize(num_samples); + #else random_sample_n(begin(), end(), std::back_insert_iterator(samples), num_samples); for (unsigned int i=0; i #include -using std::cout; -using std::endl; +#ifdef _MSC_VER // fix missing isnan for VC++ +#define isnan(x) _isnan(x) +#endif + +// on MacOS, isnan is in std (also C++11) +using namespace std; + using namespace octomap; void printUsage(char* self){ @@ -127,7 +132,7 @@ int main(int argc, char** argv) { else kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1); - if (std::isnan(kld)){ + if (isnan(kld)){ OCTOMAP_ERROR("KLD is nan! KLD(%f,%f)=%f; sum = %f", p1, p2, kld, kld_sum); exit(-1); } diff --git a/octomap/src/intersection_example.cpp b/octomap/src/intersection_example.cpp new file mode 100644 index 00000000..e79ccdbe --- /dev/null +++ b/octomap/src/intersection_example.cpp @@ -0,0 +1,92 @@ +/* + * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees + * http://octomap.github.com/ + * + * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg + * All rights reserved. + * License: New BSD + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the University of Freiburg nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include +#include + +using namespace std; +using namespace octomap; + +int main(int argc, char** argv) { + + cout << "generating example map" << endl; + + OcTree tree (0.1); // create empty tree with resolution 0.1 + + // insert some measurements of free cells + + for (float x = -2; x <= 0; x += 0.02) { + for (float y = -2; y <= 0; y += 0.02) { + for (float z = -2; z <= 0; z += 0.02) { + point3d endpoint(x, y, z); + tree.updateNode(endpoint, false); // integrate 'free' measurement + } + } + } + + // insert some measurements of occupied cells (twice as much) + for (float x = -1; x <= 0; x += 0.01) { + for (float y = -1; y <= 0; y += 0.01) { + for (float z = -1; z <= 0; z += 0.01) { + point3d endpoint(x, y, z); + tree.updateNode(endpoint, true); // integrate 'occupied' measurement + } + } + } + + point3d origin(-1.5, -1.5, -0.5); + point3d direction; + point3d ray_end; + + + for(float z = 0; z <= 0.25; z += 0.125){ + direction = point3d(1, 1, z); + cout << endl; + cout << "casting ray from " << origin << " in the " << direction << " direction"<< endl; + bool success = tree.castRay(origin, direction, ray_end); + + if(success){ + cout << "ray hit cell with center " << ray_end << endl; + + point3d intersection; + success = tree.getRayIntersection(origin, direction, ray_end, intersection); + if(success) + cout << "entrance point is " << intersection << endl; + } + } + + return 0; +} diff --git a/octomap/src/testing/test_iterators.cpp b/octomap/src/testing/test_iterators.cpp index f9f41b6a..22d7dd1b 100644 --- a/octomap/src/testing/test_iterators.cpp +++ b/octomap/src/testing/test_iterators.cpp @@ -350,7 +350,7 @@ int main(int argc, char** argv) { EXPECT_TRUE(tree->coordToKeyChecked(bbxMin, bbxMinKey)); EXPECT_TRUE(tree->coordToKeyChecked(bbxMax, bbxMaxKey)); - typedef std::tr1::unordered_map KeyVolumeMap; + typedef unordered_ns::unordered_map KeyVolumeMap; KeyVolumeMap bbxVoxels; diff --git a/octomap/src/testing/test_pruning.cpp b/octomap/src/testing/test_pruning.cpp index 4f9b231d..4a07ef72 100644 --- a/octomap/src/testing/test_pruning.cpp +++ b/octomap/src/testing/test_pruning.cpp @@ -16,9 +16,9 @@ int main(int argc, char** argv) { OcTreeNode* singleNode = tree.updateNode(singleKey, true); EXPECT_TRUE(singleNode); EXPECT_EQ(singleNode, tree.search(singlePt)); - // check all neighbors, should not exist: - OcTreeKey key; + OcTreeKey key; + // check all neighbors, none should exist: for (key[2] = singleKey[2] - 1; key[2] <= singleKey[2] + 1; ++key[2]){ for (key[1] = singleKey[1] - 1; key[1] <= singleKey[1] + 1; ++key[1]){ for (key[0] = singleKey[0] - 1; key[0] <= singleKey[0] + 1; ++key[0]){ @@ -57,7 +57,27 @@ int main(int argc, char** argv) { singleKey2[0] +=1; singleKey2[1] +=1; singleKey2[2] +=1; - EXPECT_TRUE(tree.updateNode(singleKey2, true)); + OcTreeNode* singleNode2 = tree.updateNode(singleKey2, true); + EXPECT_TRUE(singleNode2); + + for (key[2] = singleKey[2] - 1; key[2] <= singleKey[2] + 1; ++key[2]){ + for (key[1] = singleKey[1] - 1; key[1] <= singleKey[1] + 1; ++key[1]){ + for (key[0] = singleKey[0] - 1; key[0] <= singleKey[0] + 1; ++key[0]){ + if (key == singleKey){ + OcTreeNode* node = tree.search(key); + EXPECT_TRUE(node); + EXPECT_EQ(singleNode, node); + } else if (key == singleKey2){ + OcTreeNode* node = tree.search(key); + EXPECT_TRUE(node); + EXPECT_EQ(singleNode2, node); + } else{ + OcTreeNode* node = tree.search(key); + EXPECT_FALSE(node); + } + } + } + } EXPECT_EQ(tree.calcNumNodes(), tree.size()); EXPECT_EQ(tree.size(), 18); // one more leaf at lowest level // pruning should do nothing: @@ -65,7 +85,15 @@ int main(int argc, char** argv) { for (key[2] = singleKey[2] - 1; key[2] <= singleKey[2] + 1; ++key[2]){ for (key[1] = singleKey[1] - 1; key[1] <= singleKey[1] + 1; ++key[1]){ for (key[0] = singleKey[0] - 1; key[0] <= singleKey[0] + 1; ++key[0]){ - if (key != singleKey && key != singleKey2){ + if (key == singleKey){ + OcTreeNode* node = tree.search(key); + EXPECT_TRUE(node); + EXPECT_EQ(singleNode, node); + } else if (key == singleKey2){ + OcTreeNode* node = tree.search(key); + EXPECT_TRUE(node); + EXPECT_EQ(singleNode2, node); + } else{ OcTreeNode* node = tree.search(key); EXPECT_FALSE(node); } @@ -75,6 +103,27 @@ int main(int argc, char** argv) { EXPECT_EQ(tree.calcNumNodes(), tree.size()); EXPECT_EQ(tree.size(), 18); + //tree.write("pruning_test_out0.ot"); + + // fill the complete octant, should auto-prune + tree.updateNode(OcTreeKey(singleKey[0]+1, singleKey[1]+0, singleKey[2]+0), true); + tree.updateNode(OcTreeKey(singleKey[0]+1, singleKey[1]+1, singleKey[2]+0), true); + tree.updateNode(OcTreeKey(singleKey[0]+0, singleKey[1]+1, singleKey[2]+0), true); + tree.updateNode(OcTreeKey(singleKey[0]+0, singleKey[1]+0, singleKey[2]+1), true); + tree.updateNode(OcTreeKey(singleKey[0]+1, singleKey[1]+0, singleKey[2]+1), true); + EXPECT_EQ(tree.size(), 23); + // last node should trigger auto-pruning: + OcTreeNode* prunedNode = tree.updateNode(OcTreeKey(singleKey[0]+0, singleKey[1]+1, singleKey[2]+1), true); + EXPECT_EQ(tree.size(), 16); + // all queries should now end up at same parent node: + OcTreeNode* parentNode = tree.search(singleKey); + OcTreeNode* parentNode2 = tree.search(singleKey2); + EXPECT_EQ(parentNode, parentNode2); + // test pointer returned by updateNode (pruned) + EXPECT_EQ(prunedNode, parentNode); + + //tree.write("pruning_test_out1.ot"); + // now test larger volume pruning: for (float x=0.005; x <= 0.32; x+=res){ for (float y=0.005; y <= 0.32; y+=res){ @@ -86,16 +135,16 @@ int main(int argc, char** argv) { } } EXPECT_EQ(tree.calcNumNodes(), tree.size()); - EXPECT_EQ(29, tree.size()); + EXPECT_EQ(27, tree.size()); // TODO: replace with test for lazy eval? tree.prune(); EXPECT_EQ(tree.calcNumNodes(), tree.size()); - EXPECT_EQ(29, tree.size()); + EXPECT_EQ(27, tree.size()); tree.expand(); EXPECT_EQ(tree.calcNumNodes(), tree.size()); - EXPECT_EQ(37477, tree.size()); + EXPECT_EQ(37483, tree.size()); tree.prune(); - EXPECT_EQ(29, tree.size()); + EXPECT_EQ(27, tree.size()); // test expansion: for (float x=0.005; x <= 0.32; x+=res){ for (float y=0.005; y <= 0.32; y+=res){ @@ -121,10 +170,7 @@ int main(int argc, char** argv) { } } EXPECT_EQ(tree.calcNumNodes(), tree.size()); - EXPECT_EQ(69, tree.size()); - - - + EXPECT_EQ(67, tree.size()); //tree.write("pruning_test_out.ot"); std::cerr << "Test successful.\n"; diff --git a/octovis/CMakeLists.txt b/octovis/CMakeLists.txt index 7db5ee55..ed4304cb 100644 --- a/octovis/CMakeLists.txt +++ b/octovis/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT( octovis ) # # version (e.g. for packaging) set(OCTOVIS_MAJOR_VERSION 1) set(OCTOVIS_MINOR_VERSION 6) -set(OCTOVIS_PATCH_VERSION 1) +set(OCTOVIS_PATCH_VERSION 2) set(OCTOVIS_VERSION ${OCTOVIS_MAJOR_VERSION}.${OCTOVIS_MINOR_VERSION}.${OCTOVIS_PATCH_VERSION}) # get rid of a useless warning: if(COMMAND cmake_policy) @@ -22,14 +22,18 @@ SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib ) SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib ) SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin ) -# We need the main octomap library to link against. -# Look at parent directory by default, in case the complete distribution -# (octomap & octovis together) is built. -# Otherwise you need to export octomap_DIR to find the CMakeConfig. -find_package(octomap REQUIRED - HINTS ${CMAKE_SOURCE_DIR}/lib/cmake/octomap - ${CMAKE_SOURCE_DIR}/../octomap/lib/cmake/octomap +# We need the main octomap library to link against (same version as octovis) +# Look at parent directory by default, in case the complete distribution +# (octomap & octovis together) is built. +# +# Otherwise you need to export octomap_DIR to the directory containing +# the file octomap-config.cmake +find_package(octomap ${OCTOVIS_MAJOR_VERSION}.${OCTOVIS_MINOR_VERSION} REQUIRED +HINTS ${CMAKE_SOURCE_DIR}/lib/cmake/octomap +${CMAKE_SOURCE_DIR}/../octomap/lib/cmake/octomap ) +MESSAGE(STATUS "Found octomap version: " ${octomap_VERSION}) + INCLUDE_DIRECTORIES(${OCTOMAP_INCLUDE_DIRS}) # Export the package for use from the build-tree diff --git a/octovis/octovis-config.cmake.in b/octovis/octovis-config.cmake.in index 083f7a05..b278a669 100644 --- a/octovis/octovis-config.cmake.in +++ b/octovis/octovis-config.cmake.in @@ -5,20 +5,13 @@ # OCTOVIS_LIBRARY_DIRS - library directories for OctoMap viewer # OCTOVIS_LIBRARIES - libraries to link against -set(OCTOVIS_INCLUDE_DIRS @QGLViewer_INCLUDE_DIR@ @OCTOVIS_INCLUDE_DIR@) -set(OCTOVIS_LIBRARY_DIRS @QGLViewer_LIBRARY_DIR@ @OCTOVIS_LIB_DIR@) +set(OCTOVIS_INCLUDE_DIRS "@QGLViewer_INCLUDE_DIR@" "@OCTOVIS_INCLUDE_DIR@") +set(OCTOVIS_LIBRARY_DIRS "@QGLViewer_LIBRARY_DIR@" "@OCTOVIS_LIB_DIR@") -# library ext. hardcoded to dylib on Apple -if(APPLE) - set(SO_EXT ".dylib") -else(APPLE) - set(SO_EXT ".so") -endif(APPLE) - # Set library names as absolute paths: set(OCTOVIS_LIBRARIES - @QGLViewer_LIBRARIES@ - @QT_LIBRARIES@ - @OCTOVIS_LIB_DIR@/liboctovis${SO_EXT} + "@QGLViewer_LIBRARIES@" + "@QT_LIBRARIES@" + "@OCTOVIS_LIB_DIR@/liboctovis@CMAKE_SHARED_LIBRARY_SUFFIX@" ) diff --git a/octovis/package.xml b/octovis/package.xml index 84e5bdc4..a6aed7c2 100644 --- a/octovis/package.xml +++ b/octovis/package.xml @@ -1,6 +1,6 @@ octovis - 1.6.1 + 1.6.2 octovis is visualization tool for the OctoMap library based on Qt and libQGLViewer. See http://octomap.github.io for details. diff --git a/octovis/src/extern/QGLViewer/.gitignore b/octovis/src/extern/QGLViewer/.gitignore new file mode 100644 index 00000000..c02b9cc6 --- /dev/null +++ b/octovis/src/extern/QGLViewer/.gitignore @@ -0,0 +1,8 @@ +.moc +.obj +*.so +*.so.* +ui_*.h +libQGLViewer.prl + + diff --git a/octovis/src/extern/QGLViewer/CHANGELOG b/octovis/src/extern/QGLViewer/CHANGELOG new file mode 100644 index 00000000..c87f72fb --- /dev/null +++ b/octovis/src/extern/QGLViewer/CHANGELOG @@ -0,0 +1,6 @@ +This is libQGLViewer version 2.4.0. Packaged on May 28, 2013. + +The complete change log is available in doc/changeLog.html + +The latest releases and changeLog are available at: +http://www.libqglviewer.com/changeLog.html diff --git a/octovis/src/extern/QGLViewer/INSTALL b/octovis/src/extern/QGLViewer/INSTALL new file mode 100644 index 00000000..4c3bee6b --- /dev/null +++ b/octovis/src/extern/QGLViewer/INSTALL @@ -0,0 +1,24 @@ + + l i b Q G L V i e w e r I n s t a l l a t i o n + + + +libQGLViewer requires the Qt library, available from Nokia. + +Binary packages are available for different architectures. + + +If you want to compile the library from its sources: + +- On UNIX platforms, simply type (see doc/installUnix.html for details): + + > cd QGLViewer + > qmake + > make + > make install [optional] + +- For Windows installation, see doc/installWindows.html. + + + +See doc/compilation.html for details on compiling programs that use libQGLViewer. diff --git a/octovis/src/extern/QGLViewer/ImageInterface.Qt4.ui b/octovis/src/extern/QGLViewer/ImageInterface.ui similarity index 95% rename from octovis/src/extern/QGLViewer/ImageInterface.Qt4.ui rename to octovis/src/extern/QGLViewer/ImageInterface.ui index b48a5acb..db85b690 100644 --- a/octovis/src/extern/QGLViewer/ImageInterface.Qt4.ui +++ b/octovis/src/extern/QGLViewer/ImageInterface.ui @@ -13,10 +13,6 @@ Image settings - - - ../../../../../../Documents and Settings/debunne/Bureau/libQGLViewer-2.2.0-1/doc/images/qglviewer.icon.png../../../../../../Documents and Settings/debunne/Bureau/libQGLViewer-2.2.0-1/doc/images/qglviewer.icon.png - 6 diff --git a/octovis/src/extern/QGLViewer/LICENCE b/octovis/src/extern/QGLViewer/LICENCE index d71f3667..fe654178 100644 --- a/octovis/src/extern/QGLViewer/LICENCE +++ b/octovis/src/extern/QGLViewer/LICENCE @@ -1037,4 +1037,4 @@ Public License instead of this License. But first, please read ------------------------------------------------------------------------- - The QGLViewer library is Copyright (C) 2002-2008 Gilles Debunne. + The QGLViewer library is Copyright (C) 2002-2013 Gilles Debunne. diff --git a/octovis/src/extern/QGLViewer/QGLViewer.pro b/octovis/src/extern/QGLViewer/QGLViewer.pro index d5bd34f1..5093e6e5 100644 --- a/octovis/src/extern/QGLViewer/QGLViewer.pro +++ b/octovis/src/extern/QGLViewer/QGLViewer.pro @@ -10,7 +10,7 @@ TEMPLATE = lib TARGET = QGLViewer -VERSION = 2.3.17 +VERSION = 2.4.0 CONFIG *= qt opengl warn_on shared thread create_prl rtti no_keywords QGL_HEADERS = qglviewer.h \ @@ -45,8 +45,12 @@ TRANSLATIONS = qglviewer_fr.ts QT_VERSION=$$[QT_VERSION] -contains( QT_VERSION, "^4.*" ) { - QT *= xml opengl +!contains( QT_VERSION, "^3.*" ) { + QT *= xml opengl +} + +contains ( QT_VERSION, "^5.*" ) { + QT *= widgets } !isEmpty( QGLVIEWER_STATIC ) { @@ -56,10 +60,10 @@ contains( QT_VERSION, "^4.*" ) { # ----------------------------------- # -- I m a g e I n t e r f a c e -- # ----------------------------------- -contains( QT_VERSION, "^4.*" ) { - FORMS *= ImageInterface.Qt4.ui -} else { +contains( QT_VERSION, "^3.*" ) { FORMS *= ImageInterface.Qt3.ui +} else { + FORMS *= ImageInterface.ui } # --------------------------------------------- @@ -71,10 +75,10 @@ contains( QT_VERSION, "^4.*" ) { contains( DEFINES, NO_VECTORIAL_RENDER ) { message( Vectorial rendering disabled ) } else { - contains( QT_VERSION, "^4.*" ) { - FORMS *= VRenderInterface.Qt4.ui - } else { + contains( QT_VERSION, "^3.*" ) { FORMS *= VRenderInterface.Qt3.ui + } else { + FORMS *= VRenderInterface.ui } SOURCES *= \ @@ -124,21 +128,33 @@ unix { # INCLUDE_DIR and LIB_DIR specify where to install the include files and the library. # Use qmake INCLUDE_DIR=... LIB_DIR=... , or qmake PREFIX=... to customize your installation. + + HOME_DIR = $$system(cd;pwd) + isEmpty( PREFIX ) { - PREFIX=/usr + PREFIX_=/usr + } else { + PREFIX_=$${PREFIX} } isEmpty( LIB_DIR ) { - LIB_DIR = $${PREFIX}/lib + LIB_DIR_ = $${PREFIX_}/lib + } else { + LIB_DIR_ = $${LIB_DIR} } isEmpty( INCLUDE_DIR ) { - INCLUDE_DIR = $${PREFIX}/include + INCLUDE_DIR_ = $${PREFIX_}/include + } else { + INCLUDE_DIR_ = $${INCLUDE_DIR} } - isEmpty( DOC_DIR ) { macx|darwin-g++ { - DOC_DIR = /Developer/Documentation/QGLViewer + isEmpty( PREFIX ) { + DOC_DIR = $${HOME_DIR}/Library/Developer/Shared/Documentation/QGLViewer + } else { + DOC_DIR = $${PREFIX}/Shared/Documentation/QGLViewer + } } else { - DOC_DIR = $${PREFIX}/share/doc/QGLViewer + DOC_DIR = $${PREFIX_}/share/doc/QGLViewer } } @@ -161,7 +177,7 @@ unix { QMAKE_CXXFLAGS_RELEASE -= -g # install header - include.path = $${INCLUDE_DIR}/QGLViewer + include.path = $${INCLUDE_DIR_}/QGLViewer # Should be $$replace(TRANSLATIONS, .ts, .qm), but 'replace' only appeared in Qt 4.3 include.files = $${QGL_HEADERS} qglviewer_fr.qm @@ -183,28 +199,16 @@ unix { # install static library #staticlib.extra = make -f Makefile.Release staticlib - #staticlib.path = $${LIB_DIR} + #staticlib.path = $${LIB_DIR_} #staticlib.files = lib$${TARGET}.a # install library - target.path = $${LIB_DIR} + target.path = $${LIB_DIR_} # "make install" configuration options INSTALLS *= target include documentation docImages docRefManual } -# ----------------- -# -- L i n u x -- -# ----------------- -linux-g++ { - # Patch for gcc 3.2.0 and 3.3.1-2 - system( g++ --version | grep " 3\.2\.0 " > /dev/null )|system( g++ --version | grep " 3\.3\.1\-2" > /dev/null ) { - message( Patching gcc bug - using debug configuration ) - CONFIG -= release - CONFIG *= debug - } -} - # ----------------------- # -- S G I I r i x -- @@ -235,7 +239,7 @@ irix-cc|irix-n32 { # ------------------- macx|darwin-g++ { # This setting creates a Mac framework. Comment out this line to create a dylib instead. - CONFIG *= lib_bundle + !staticlib: CONFIG *= lib_bundle include.files *= qglviewer.icns @@ -246,8 +250,22 @@ macx|darwin-g++ { FRAMEWORK_HEADERS.path = Headers QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS - DESTDIR = ~/Library/Frameworks/ + DESTDIR = $${HOME_DIR}/Library/Frameworks/ + # For a Framework, 'include' and 'lib' do no make sense. + # These and prefix will all define the DESTDIR, in that order in case several are defined + !isEmpty( INCLUDE_DIR ) { + DESTDIR = $${INCLUDE_DIR} + } + + !isEmpty( LIB_DIR ) { + DESTDIR = $${LIB_DIR} + } + + !isEmpty( PREFIX ) { + DESTDIR = $${PREFIX} + } + QMAKE_POST_LINK=cd $$DESTDIR/QGLViewer.framework/Headers && (test -L QGLViewer || ln -s . QGLViewer) #QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/ @@ -296,6 +314,7 @@ win32 { # Any feedback on these flags is welcome. !win32-g++ { QMAKE_CXXFLAGS = -TP -GR -Zi + DEFINES += NOMINMAX win32-msvc { QMAKE_CXXFLAGS *= -GX } else { @@ -305,7 +324,7 @@ win32 { } -contains( QT_VERSION, "^4.*" ) { +!contains( QT_VERSION, "^3.*" ) { build_pass:CONFIG(debug, debug|release) { unix: TARGET = $$join(TARGET,,,_debug) else: TARGET = $$join(TARGET,,,d) diff --git a/octovis/src/extern/QGLViewer/README b/octovis/src/extern/QGLViewer/README index 64b6dcf6..4dd7b3d5 100644 --- a/octovis/src/extern/QGLViewer/README +++ b/octovis/src/extern/QGLViewer/README @@ -1,10 +1,10 @@ l i b Q G L V i e w e r - Version 2.3.10. Packaged on June -d, 2011 + Version 2.4.0. Packaged on May 28, 2013 - Copyright (C) 2002-2008 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. http://www.libqglviewer.com Send e-mail to contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/AxisAlignedBox.h b/octovis/src/extern/QGLViewer/VRender/AxisAlignedBox.h index 2d97a5a0..84a0c55f 100644 --- a/octovis/src/extern/QGLViewer/VRender/AxisAlignedBox.h +++ b/octovis/src/extern/QGLViewer/VRender/AxisAlignedBox.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/BSPSortMethod.cpp b/octovis/src/extern/QGLViewer/VRender/BSPSortMethod.cpp index dc83e3e1..7aa69379 100644 --- a/octovis/src/extern/QGLViewer/VRender/BSPSortMethod.cpp +++ b/octovis/src/extern/QGLViewer/VRender/BSPSortMethod.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/BackFaceCullingOptimizer.cpp b/octovis/src/extern/QGLViewer/VRender/BackFaceCullingOptimizer.cpp index d38b35c3..00e9a429 100644 --- a/octovis/src/extern/QGLViewer/VRender/BackFaceCullingOptimizer.cpp +++ b/octovis/src/extern/QGLViewer/VRender/BackFaceCullingOptimizer.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/EPSExporter.cpp b/octovis/src/extern/QGLViewer/VRender/EPSExporter.cpp index 13986647..f7edb4a5 100644 --- a/octovis/src/extern/QGLViewer/VRender/EPSExporter.cpp +++ b/octovis/src/extern/QGLViewer/VRender/EPSExporter.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Exporter.cpp b/octovis/src/extern/QGLViewer/VRender/Exporter.cpp index 97ac5bc3..9cf0708f 100644 --- a/octovis/src/extern/QGLViewer/VRender/Exporter.cpp +++ b/octovis/src/extern/QGLViewer/VRender/Exporter.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Exporter.h b/octovis/src/extern/QGLViewer/VRender/Exporter.h index fc2b1cd9..bccd1e60 100644 --- a/octovis/src/extern/QGLViewer/VRender/Exporter.h +++ b/octovis/src/extern/QGLViewer/VRender/Exporter.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/FIGExporter.cpp b/octovis/src/extern/QGLViewer/VRender/FIGExporter.cpp index 00bbbd4b..85f58242 100644 --- a/octovis/src/extern/QGLViewer/VRender/FIGExporter.cpp +++ b/octovis/src/extern/QGLViewer/VRender/FIGExporter.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/NVector3.cpp b/octovis/src/extern/QGLViewer/VRender/NVector3.cpp index 86f1daab..d59d5366 100644 --- a/octovis/src/extern/QGLViewer/VRender/NVector3.cpp +++ b/octovis/src/extern/QGLViewer/VRender/NVector3.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/NVector3.h b/octovis/src/extern/QGLViewer/VRender/NVector3.h index 083beb71..5501fef9 100644 --- a/octovis/src/extern/QGLViewer/VRender/NVector3.h +++ b/octovis/src/extern/QGLViewer/VRender/NVector3.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Optimizer.h b/octovis/src/extern/QGLViewer/VRender/Optimizer.h index c1767fa5..ea2ddb7e 100644 --- a/octovis/src/extern/QGLViewer/VRender/Optimizer.h +++ b/octovis/src/extern/QGLViewer/VRender/Optimizer.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/ParserGL.cpp b/octovis/src/extern/QGLViewer/VRender/ParserGL.cpp index 4e488683..11300ca2 100644 --- a/octovis/src/extern/QGLViewer/VRender/ParserGL.cpp +++ b/octovis/src/extern/QGLViewer/VRender/ParserGL.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/ParserGL.h b/octovis/src/extern/QGLViewer/VRender/ParserGL.h index d193d1bb..cfdd2c54 100644 --- a/octovis/src/extern/QGLViewer/VRender/ParserGL.h +++ b/octovis/src/extern/QGLViewer/VRender/ParserGL.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Primitive.cpp b/octovis/src/extern/QGLViewer/VRender/Primitive.cpp index f929bf4b..79d77f91 100644 --- a/octovis/src/extern/QGLViewer/VRender/Primitive.cpp +++ b/octovis/src/extern/QGLViewer/VRender/Primitive.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Primitive.h b/octovis/src/extern/QGLViewer/VRender/Primitive.h index 08d4cfd7..e4a10e2e 100644 --- a/octovis/src/extern/QGLViewer/VRender/Primitive.h +++ b/octovis/src/extern/QGLViewer/VRender/Primitive.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.cpp b/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.cpp index 36fc798b..a8a900a6 100644 --- a/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.cpp +++ b/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.h b/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.h index b9f03fe2..7500b999 100644 --- a/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.h +++ b/octovis/src/extern/QGLViewer/VRender/PrimitivePositioning.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/SortMethod.h b/octovis/src/extern/QGLViewer/VRender/SortMethod.h index 657b1c0d..ae3c3145 100644 --- a/octovis/src/extern/QGLViewer/VRender/SortMethod.h +++ b/octovis/src/extern/QGLViewer/VRender/SortMethod.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/TopologicalSortMethod.cpp b/octovis/src/extern/QGLViewer/VRender/TopologicalSortMethod.cpp index 0423c17b..09ef3b38 100644 --- a/octovis/src/extern/QGLViewer/VRender/TopologicalSortMethod.cpp +++ b/octovis/src/extern/QGLViewer/VRender/TopologicalSortMethod.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Types.h b/octovis/src/extern/QGLViewer/VRender/Types.h index 8bba3a1a..3f9d16bd 100644 --- a/octovis/src/extern/QGLViewer/VRender/Types.h +++ b/octovis/src/extern/QGLViewer/VRender/Types.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/VRender.cpp b/octovis/src/extern/QGLViewer/VRender/VRender.cpp index 83926b7d..26036115 100644 --- a/octovis/src/extern/QGLViewer/VRender/VRender.cpp +++ b/octovis/src/extern/QGLViewer/VRender/VRender.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/VRender.h b/octovis/src/extern/QGLViewer/VRender/VRender.h index 537b8fe2..79ca156d 100644 --- a/octovis/src/extern/QGLViewer/VRender/VRender.h +++ b/octovis/src/extern/QGLViewer/VRender/VRender.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Vector2.cpp b/octovis/src/extern/QGLViewer/VRender/Vector2.cpp index 79280744..14aba5a2 100644 --- a/octovis/src/extern/QGLViewer/VRender/Vector2.cpp +++ b/octovis/src/extern/QGLViewer/VRender/Vector2.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Vector2.h b/octovis/src/extern/QGLViewer/VRender/Vector2.h index 1159ec39..fd97d7ad 100644 --- a/octovis/src/extern/QGLViewer/VRender/Vector2.h +++ b/octovis/src/extern/QGLViewer/VRender/Vector2.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Vector3.cpp b/octovis/src/extern/QGLViewer/VRender/Vector3.cpp index 1da8982f..c629370f 100644 --- a/octovis/src/extern/QGLViewer/VRender/Vector3.cpp +++ b/octovis/src/extern/QGLViewer/VRender/Vector3.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/Vector3.h b/octovis/src/extern/QGLViewer/VRender/Vector3.h index 43ef3157..5935ce5b 100644 --- a/octovis/src/extern/QGLViewer/VRender/Vector3.h +++ b/octovis/src/extern/QGLViewer/VRender/Vector3.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/VisibilityOptimizer.cpp b/octovis/src/extern/QGLViewer/VRender/VisibilityOptimizer.cpp index 2ff8f8b1..9c3d7353 100644 --- a/octovis/src/extern/QGLViewer/VRender/VisibilityOptimizer.cpp +++ b/octovis/src/extern/QGLViewer/VRender/VisibilityOptimizer.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/gpc.cpp b/octovis/src/extern/QGLViewer/VRender/gpc.cpp index ac4e06c8..8ea2d76f 100644 --- a/octovis/src/extern/QGLViewer/VRender/gpc.cpp +++ b/octovis/src/extern/QGLViewer/VRender/gpc.cpp @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRender/gpc.h b/octovis/src/extern/QGLViewer/VRender/gpc.h index fdf2ebb1..063901db 100644 --- a/octovis/src/extern/QGLViewer/VRender/gpc.h +++ b/octovis/src/extern/QGLViewer/VRender/gpc.h @@ -22,9 +22,9 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/VRenderInterface.Qt4.ui b/octovis/src/extern/QGLViewer/VRenderInterface.ui similarity index 100% rename from octovis/src/extern/QGLViewer/VRenderInterface.Qt4.ui rename to octovis/src/extern/QGLViewer/VRenderInterface.ui diff --git a/octovis/src/extern/QGLViewer/camera.cpp b/octovis/src/extern/QGLViewer/camera.cpp index fffd1abb..958c59b0 100644 --- a/octovis/src/extern/QGLViewer/camera.cpp +++ b/octovis/src/extern/QGLViewer/camera.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/camera.h b/octovis/src/extern/QGLViewer/camera.h index beb02b70..1f0bf315 100644 --- a/octovis/src/extern/QGLViewer/camera.h +++ b/octovis/src/extern/QGLViewer/camera.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -489,8 +489,8 @@ public Q_SLOTS: expressed in physical real world units, while the latter is expressed in OpenGL virtual world units. - This is a helper function. It simply returns physicalScreenWidth() / tan(horizontalFieldOfView() / 2.0); */ - float physicalDistanceToScreen() const { return physicalScreenWidth() / tan(horizontalFieldOfView() / 2.0); }; + This is a helper function. It simply returns physicalScreenWidth() / 2.0 / tan(horizontalFieldOfView() / 2.0); */ + float physicalDistanceToScreen() const { return physicalScreenWidth() / 2.0f / tan(horizontalFieldOfView() / 2.0); }; /*! Returns the physical screen width, in meters. Default value is 0.5m (average monitor width). diff --git a/octovis/src/extern/QGLViewer/config.h b/octovis/src/extern/QGLViewer/config.h index aa5720e2..a772e418 100644 --- a/octovis/src/extern/QGLViewer/config.h +++ b/octovis/src/extern/QGLViewer/config.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -28,7 +28,7 @@ #ifndef QGLVIEWER_CONFIG_H #define QGLVIEWER_CONFIG_H -#define QGLVIEWER_VERSION 0x020311 +#define QGLVIEWER_VERSION 0x020400 // Needed for Qt < 4 (?) #ifndef QT_CLEAN_NAMESPACE @@ -36,7 +36,6 @@ #endif // Get QT_VERSION and other Qt flags -// Cannot use for backward compatibility #include #if QT_VERSION < 0x030000 diff --git a/octovis/src/extern/QGLViewer/constraint.cpp b/octovis/src/extern/QGLViewer/constraint.cpp index d55dd151..ef5ebbbf 100644 --- a/octovis/src/extern/QGLViewer/constraint.cpp +++ b/octovis/src/extern/QGLViewer/constraint.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/constraint.h b/octovis/src/extern/QGLViewer/constraint.h index b4b7401b..3e7dd65f 100644 --- a/octovis/src/extern/QGLViewer/constraint.h +++ b/octovis/src/extern/QGLViewer/constraint.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/domUtils.h b/octovis/src/extern/QGLViewer/domUtils.h index 73d8600a..f6e9edf4 100644 --- a/octovis/src/extern/QGLViewer/domUtils.h +++ b/octovis/src/extern/QGLViewer/domUtils.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -20,9 +20,9 @@ *****************************************************************************/ +#include "config.h" -#if QT_VERSION > 0x040000 -# include +#if QT_VERSION >= 0x040000 # include # include # include diff --git a/octovis/src/extern/QGLViewer/frame.cpp b/octovis/src/extern/QGLViewer/frame.cpp index 3bdf66e7..93bdf101 100644 --- a/octovis/src/extern/QGLViewer/frame.cpp +++ b/octovis/src/extern/QGLViewer/frame.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/frame.h b/octovis/src/extern/QGLViewer/frame.h index faff596a..5b31d1a5 100644 --- a/octovis/src/extern/QGLViewer/frame.h +++ b/octovis/src/extern/QGLViewer/frame.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/keyFrameInterpolator.cpp b/octovis/src/extern/QGLViewer/keyFrameInterpolator.cpp index 06990fac..aa0de3af 100644 --- a/octovis/src/extern/QGLViewer/keyFrameInterpolator.cpp +++ b/octovis/src/extern/QGLViewer/keyFrameInterpolator.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/keyFrameInterpolator.h b/octovis/src/extern/QGLViewer/keyFrameInterpolator.h index 0f899c93..11daeb82 100644 --- a/octovis/src/extern/QGLViewer/keyFrameInterpolator.h +++ b/octovis/src/extern/QGLViewer/keyFrameInterpolator.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/keySequence.cpp b/octovis/src/extern/QGLViewer/keySequence.cpp deleted file mode 100644 index c62acb05..00000000 --- a/octovis/src/extern/QGLViewer/keySequence.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** - - Copyright (C) 2002-2008 Gilles Debunne. All rights reserved. - - This file is part of the QGLViewer library version 2.3.1. - - http://www.libqglviewer.com - contact@libqglviewer.com - - This file may be used under the terms of the GNU General Public License - versions 2.0 or 3.0 as published by the Free Software Foundation and - appearing in the LICENSE file included in the packaging of this file. - In addition, as a special exception, Gilles Debunne gives you certain - additional rights, described in the file GPL_EXCEPTION in this package. - - libQGLViewer uses dual licensing. Commercial/proprietary software must - purchase a libQGLViewer Commercial License. - - This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -*****************************************************************************/ - - -// The code of these methods is largely inspired from the Qt QKeySequence -// implementation, distributed under the GPL licence. -// Original Copyright to Trolltech AS. - -#include "keySequence.h" - -#include - -static struct { - int key; - const char* name; -} keyname[] = { - { Qt::Key_Space, QT_TRANSLATE_NOOP( "QAccel", "Space" ) }, - { Qt::Key_Tab, QT_TRANSLATE_NOOP( "QAccel", "Tab" ) }, - { Qt::Key_Backtab, QT_TRANSLATE_NOOP( "QAccel", "Backtab" ) }, - { Qt::Key_Backspace, QT_TRANSLATE_NOOP( "QAccel", "Backspace" ) }, - { Qt::Key_Return, QT_TRANSLATE_NOOP( "QAccel", "Return" ) }, - { Qt::Key_Enter, QT_TRANSLATE_NOOP( "QAccel", "Enter" ) }, - { Qt::Key_Pause, QT_TRANSLATE_NOOP( "QAccel", "Pause" ) }, - { Qt::Key_SysReq, QT_TRANSLATE_NOOP( "QAccel", "SysReq" ) }, - { Qt::Key_Home, QT_TRANSLATE_NOOP( "QAccel", "Home" ) }, - { Qt::Key_End, QT_TRANSLATE_NOOP( "QAccel", "End" ) }, - { Qt::Key_Left, QT_TRANSLATE_NOOP( "QAccel", "Left" ) }, - { Qt::Key_Up, QT_TRANSLATE_NOOP( "QAccel", "Up" ) }, - { Qt::Key_Right, QT_TRANSLATE_NOOP( "QAccel", "Right" ) }, - { Qt::Key_Down, QT_TRANSLATE_NOOP( "QAccel", "Down" ) }, - { Qt::Key_Menu, QT_TRANSLATE_NOOP( "QAccel", "Menu" ) }, - { Qt::Key_Help, QT_TRANSLATE_NOOP( "QAccel", "Help" ) }, - { Qt::Key_Print, QT_TRANSLATE_NOOP( "QAccel", "Print Screen" ) }, - { Qt::Key_Prior, QT_TRANSLATE_NOOP( "QAccel", "Page Up" ) }, - { Qt::Key_Next, QT_TRANSLATE_NOOP( "QAccel", "Page Down" ) }, - { Qt::Key_CapsLock, QT_TRANSLATE_NOOP( "QAccel", "Caps Lock" ) }, - { Qt::Key_NumLock, QT_TRANSLATE_NOOP( "QAccel", "Num Lock" ) }, - { Qt::Key_ScrollLock, QT_TRANSLATE_NOOP( "QAccel", "Scroll Lock" ) }, - { Qt::Key_Insert, QT_TRANSLATE_NOOP( "QAccel", "Insert" ) }, - { Qt::Key_Delete, QT_TRANSLATE_NOOP( "QAccel", "Delete" ) }, - { Qt::Key_Escape, QT_TRANSLATE_NOOP( "QAccel", "Escape" ) }, - { 0, 0 } -}; - - -QKeySequence::QKeySequence(int key) -{ - key_ = key; -} - - -/*! - Creates a shortcut string for the key sequence. - For instance CTRL+Key_O gives "Ctrl+O". If the key sequence has - multiple key codes they are returned comma-separated, e.g. - "Alt+X, Ctrl+Y, Z". The strings, "Ctrl", "Shift", etc. are - translated (using QObject::tr()) in the "QAccel" scope. If the key - sequence has no keys, QString::null is returned. -*/ -QKeySequence::operator QString() const -{ - QString s; - - // On other systems the order is Meta, Control, Alt, Shift - if ( (key_ & Qt::CTRL) == Qt::CTRL ) { - if ( !s.isEmpty() ) - s += QAccel::tr( "+" ); - s += QAccel::tr( "Ctrl" ); - } - if ( (key_ & Qt::ALT) == Qt::ALT ) { - if ( !s.isEmpty() ) - s += QAccel::tr( "+" ); - s += QAccel::tr( "Alt" ); - } - if ( (key_ & Qt::SHIFT) == Qt::SHIFT ) { - if ( !s.isEmpty() ) - s += QAccel::tr( "+" ); - s += QAccel::tr( "Shift" ); - } - - - int key = key_ & ~(Qt::SHIFT | Qt::CTRL | Qt::ALT ); - QString p; - - if ( (key & Qt::UNICODE_ACCEL) == Qt::UNICODE_ACCEL ) { - // Note: This character should NOT be upper()'ed, since - // the encoded string should indicate EXACTLY what the - // key represents! Hence a 'Ctrl+Shift+c' is posible to - // represent, but is clearly impossible to trigger... - p = QChar(key & 0xffff); - } else if ( key >= Qt::Key_F1 && key <= Qt::Key_F35 ) { - p = QAccel::tr( "F%1" ).arg(key - Qt::Key_F1 + 1); - } else if ( key > Qt::Key_Space && key <= Qt::Key_AsciiTilde ) { - p.sprintf( "%c", key ); - } else { - int i=0; - while (keyname[i].name) { - if ( key == keyname[i].key ) { - p = QAccel::tr(keyname[i].name); - break; - } - ++i; - } - // If we can't find the actual translatable keyname, - // fall back on the unicode representation of it... - // Or else characters like Key_aring may not get displayed - // ( Really depends on you locale ) - if ( key && !keyname[i].name ) - // Note: This character should NOT be upper()'ed, see above! - p = QChar(key & 0xffff); - } - - if ( !s.isEmpty() ) - s += QAccel::tr( "+" ); - - s += p; - return s; -} diff --git a/octovis/src/extern/QGLViewer/keySequence.h b/octovis/src/extern/QGLViewer/keySequence.h deleted file mode 100644 index 61d0d252..00000000 --- a/octovis/src/extern/QGLViewer/keySequence.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - - Copyright (C) 2002-2008 Gilles Debunne. All rights reserved. - - This file is part of the QGLViewer library version 2.3.1. - - http://www.libqglviewer.com - contact@libqglviewer.com - - This file may be used under the terms of the GNU General Public License - versions 2.0 or 3.0 as published by the Free Software Foundation and - appearing in the LICENSE file included in the packaging of this file. - In addition, as a special exception, Gilles Debunne gives you certain - additional rights, described in the file GPL_EXCEPTION in this package. - - libQGLViewer uses dual licensing. Commercial/proprietary software must - purchase a libQGLViewer Commercial License. - - This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -*****************************************************************************/ - -#ifndef QGLVIEWER_QKEYSEQUENCE_H -#define QGLVIEWER_QKEYSEQUENCE_H - -#if QT_VERSION >= 0x040000 -# include -#else -# include -#endif - -class QKeySequence -{ -public: - QKeySequence(int key); - operator QString() const; - -private: - int key_; -}; - -#endif // QGLVIEWER_QKEYSEQUENCE_H diff --git a/octovis/src/extern/QGLViewer/manipulatedCameraFrame.cpp b/octovis/src/extern/QGLViewer/manipulatedCameraFrame.cpp index d050ef68..0eda0b6e 100644 --- a/octovis/src/extern/QGLViewer/manipulatedCameraFrame.cpp +++ b/octovis/src/extern/QGLViewer/manipulatedCameraFrame.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/manipulatedCameraFrame.h b/octovis/src/extern/QGLViewer/manipulatedCameraFrame.h index 2166141c..7bb51fde 100644 --- a/octovis/src/extern/QGLViewer/manipulatedCameraFrame.h +++ b/octovis/src/extern/QGLViewer/manipulatedCameraFrame.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/manipulatedFrame.cpp b/octovis/src/extern/QGLViewer/manipulatedFrame.cpp index a78cbb04..bdececde 100644 --- a/octovis/src/extern/QGLViewer/manipulatedFrame.cpp +++ b/octovis/src/extern/QGLViewer/manipulatedFrame.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -51,7 +51,7 @@ ManipulatedFrame::ManipulatedFrame() setWheelSensitivity(1.0f); isSpinning_ = false; - previousConstraint_ = false; + previousConstraint_ = NULL; connect(&spinningTimer_, SIGNAL(timeout()), SLOT(spinUpdate())); } diff --git a/octovis/src/extern/QGLViewer/manipulatedFrame.h b/octovis/src/extern/QGLViewer/manipulatedFrame.h index dfbff4dc..2888fd0c 100644 --- a/octovis/src/extern/QGLViewer/manipulatedFrame.h +++ b/octovis/src/extern/QGLViewer/manipulatedFrame.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/mouseGrabber.cpp b/octovis/src/extern/QGLViewer/mouseGrabber.cpp index 95414a54..a214fe3b 100644 --- a/octovis/src/extern/QGLViewer/mouseGrabber.cpp +++ b/octovis/src/extern/QGLViewer/mouseGrabber.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/mouseGrabber.h b/octovis/src/extern/QGLViewer/mouseGrabber.h index bac39778..f08a91cd 100644 --- a/octovis/src/extern/QGLViewer/mouseGrabber.h +++ b/octovis/src/extern/QGLViewer/mouseGrabber.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/qglviewer.cpp b/octovis/src/extern/QGLViewer/qglviewer.cpp index d9d396cf..6dce7551 100644 --- a/octovis/src/extern/QGLViewer/qglviewer.cpp +++ b/octovis/src/extern/QGLViewer/qglviewer.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -76,22 +76,16 @@ libQGLViewer is a free C++ library based on Qt that enables the quick creation o It features a powerful camera trackball and simple applications simply require an implementation of the draw() method. This makes it a tool of choice for OpenGL beginners and assignments. It provides screenshot saving, mouse manipulated frames, stereo display, interpolated -keyFrames, object selection, and much -more. It is fully +keyFrames, object selection, and much more. It is fully customizable and easy to extend to create complex applications, with a possible Qt GUI. libQGLViewer is not a 3D viewer that can be used directly to view 3D scenes in various formats. It is more likely to be the starting point for the coding of such a viewer. libQGLViewer is based on the Qt toolkit and hence compiles on any architecture (Unix-Linux, Mac, -Windows, ...). Full reference -documentation and many examples are -provided. +Windows, ...). Full reference documentation and many examples are provided. -See the project main page for -details on the project and installation steps. */ +See the project main page for details on the project and installation steps. */ void QGLViewer::defaultConstructor() { @@ -197,7 +191,7 @@ the associated documentation. If the \p shareWidget parameter points to a valid \c QGLWidget, the QGLViewer will share the OpenGL context with \p shareWidget (see isSharing()). */ -QGLViewer::QGLViewer(QWidget* parent, const QGLWidget* shareWidget, Qt::WFlags flags) +QGLViewer::QGLViewer(QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags flags) : QGLWidget(parent, shareWidget, flags) { defaultConstructor(); } @@ -206,7 +200,7 @@ with \c QGLContext sub-classes (use \p shareWidget otherwise). \note This constructor is correctly working only with Qt versions greater or equal than 3.2. The provided \p context is simply ignored otherwise. */ -QGLViewer::QGLViewer(QGLContext *context, QWidget* parent, const QGLWidget* shareWidget, Qt::WFlags flags) +QGLViewer::QGLViewer(QGLContext *context, QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags flags) : QGLWidget(context, parent, shareWidget, flags) { defaultConstructor(); } @@ -214,7 +208,7 @@ QGLViewer::QGLViewer(QGLContext *context, QWidget* parent, const QGLWidget* shar This is for instance needed to ask for a stencil buffer or for stereo display (as is illustrated in the stereoViewer example). */ -QGLViewer::QGLViewer(const QGLFormat& format, QWidget* parent, const QGLWidget* shareWidget, Qt::WFlags flags) +QGLViewer::QGLViewer(const QGLFormat& format, QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags flags) : QGLWidget(format, parent, shareWidget, flags) { defaultConstructor(); } #endif @@ -272,10 +266,10 @@ static int convertToKeyboardModifiers(int state) return state; } -static QtKeyboardModifiers convertKeyboardModifiers(QtKeyboardModifiers modifiers) +static Qt::KeyboardModifiers convertKeyboardModifiers(Qt::KeyboardModifiers modifiers) { #if QT_VERSION < 0x040000 - return QtKeyboardModifiers(convertToKeyboardModifiers(modifiers)); + return Qt::KeyboardModifiers(convertToKeyboardModifiers(modifiers)); #else return modifiers; #endif @@ -623,17 +617,17 @@ void QGLViewer::setDefaultShortcuts() void QGLViewer::setDefaultMouseBindings() { #if QT_VERSION >= 0x040000 - const QtKeyboardModifiers cameraKeyboardModifiers = Qt::NoModifier; - const QtKeyboardModifiers frameKeyboardModifiers = Qt::ControlModifier; + const Qt::KeyboardModifiers cameraKeyboardModifiers = Qt::NoModifier; + const Qt::KeyboardModifiers frameKeyboardModifiers = Qt::ControlModifier; #else - const QtKeyboardModifiers cameraKeyboardModifiers = Qt::NoButton; - const QtKeyboardModifiers frameKeyboardModifiers = Qt::ControlButton; + const Qt::KeyboardModifiers cameraKeyboardModifiers = Qt::NoButton; + const Qt::KeyboardModifiers frameKeyboardModifiers = Qt::ControlButton; #endif //#CONNECTION# toggleCameraMode() for (int handler=0; handler<2; ++handler) { MouseHandler mh = (MouseHandler)(handler); - QtKeyboardModifiers modifiers = (mh == FRAME) ? frameKeyboardModifiers : cameraKeyboardModifiers; + Qt::KeyboardModifiers modifiers = (mh == FRAME) ? frameKeyboardModifiers : cameraKeyboardModifiers; setMouseBinding(modifiers | Qt::LeftButton, mh, ROTATE); setMouseBinding(modifiers | Qt::MidButton, mh, ZOOM); @@ -647,36 +641,36 @@ void QGLViewer::setDefaultMouseBindings() #if QT_VERSION >= 0x040000 // Z o o m o n r e g i o n - setMouseBinding(Qt::ShiftModifier | Qt::MidButton, CAMERA, ZOOM_ON_REGION); + setMouseBinding(Qt::SHIFT + Qt::MidButton, CAMERA, ZOOM_ON_REGION); // S e l e c t - setMouseBinding(Qt::ShiftModifier | Qt::LeftButton, SELECT); + setMouseBinding(Qt::SHIFT + Qt::LeftButton, SELECT); #else - setMouseBinding(Qt::ShiftButton | Qt::MidButton, CAMERA, ZOOM_ON_REGION); - setMouseBinding(Qt::ShiftButton | Qt::LeftButton, SELECT); + setMouseBinding(Qt::SHIFT + Qt::MidButton, CAMERA, ZOOM_ON_REGION); + setMouseBinding(Qt::SHIFT + Qt::LeftButton, SELECT); #endif // D o u b l e c l i c k - setMouseBinding(Qt::LeftButton, ALIGN_CAMERA, true); - setMouseBinding(Qt::MidButton, SHOW_ENTIRE_SCENE, true); - setMouseBinding(Qt::RightButton, CENTER_SCENE, true); + setMouseBinding(Qt::LeftButton, ALIGN_CAMERA, true); + setMouseBinding(Qt::MidButton, SHOW_ENTIRE_SCENE, true); + setMouseBinding(Qt::RightButton, CENTER_SCENE, true); setMouseBinding(frameKeyboardModifiers | Qt::LeftButton, ALIGN_FRAME, true); setMouseBinding(frameKeyboardModifiers | Qt::RightButton, CENTER_FRAME, true); // S p e c i f i c d o u b l e c l i c k s - setMouseBinding(Qt::LeftButton, RAP_FROM_PIXEL, true, Qt::RightButton); - setMouseBinding(Qt::RightButton, RAP_IS_CENTER, true, Qt::LeftButton); - setMouseBinding(Qt::LeftButton, ZOOM_ON_PIXEL, true, Qt::MidButton); - setMouseBinding(Qt::RightButton, ZOOM_TO_FIT, true, Qt::MidButton); + setMouseBinding(Qt::LeftButton, RAP_FROM_PIXEL, true, Qt::RightButton); + setMouseBinding(Qt::RightButton, RAP_IS_CENTER, true, Qt::LeftButton); + setMouseBinding(Qt::LeftButton, ZOOM_ON_PIXEL, true, Qt::MidButton); + setMouseBinding(Qt::RightButton, ZOOM_TO_FIT, true, Qt::MidButton); #ifdef Q_OS_MAC // Specific Mac bindings. Double finger emulates a wheelEvent which zooms. // Make Option + left emulate the right button. Other bindings should be changed accordingly. // Done at the end to override previous settings. # if QT_VERSION >= 0x040000 - const QtKeyboardModifiers macKeyboardModifiers = Qt::AltModifier; + const Qt::KeyboardModifiers macKeyboardModifiers = Qt::AltModifier; # else - const QtKeyboardModifiers macKeyboardModifiers = Qt::AltButton; + const Qt::KeyboardModifiers macKeyboardModifiers = Qt::AltButton; # endif setMouseBinding(macKeyboardModifiers | Qt::LeftButton, CAMERA, TRANSLATE); @@ -686,11 +680,11 @@ void QGLViewer::setDefaultMouseBindings() // S p e c i f i c d o u b l e c l i c k s // A single tap is actually seen as a left followed by a right button click. - setMouseBinding(Qt::MetaModifier | Qt::RightButton, RAP_FROM_PIXEL, true, Qt::LeftButton); - setMouseBinding(Qt::ShiftModifier | Qt::MetaModifier | Qt::RightButton, RAP_IS_CENTER, true, Qt::LeftButton); + setMouseBinding(Qt::META + Qt::RightButton, RAP_FROM_PIXEL, true, Qt::LeftButton); + setMouseBinding(Qt::SHIFT + Qt::META + Qt::RightButton, RAP_IS_CENTER, true, Qt::LeftButton); // A tap with two fingers is actually considered a rightButton. - setMouseBinding(Qt::MetaModifier | Qt::RightButton, ZOOM_ON_PIXEL, false); - setMouseBinding(Qt::ShiftModifier | Qt::MetaModifier | Qt::RightButton, ZOOM_TO_FIT, false); + setMouseBinding(Qt::META + Qt::RightButton, ZOOM_ON_PIXEL, false); + setMouseBinding(Qt::SHIFT + Qt::MetaModifier | Qt::RightButton, ZOOM_TO_FIT, false); #endif } @@ -1426,11 +1420,11 @@ void QGLViewer::mousePressEvent(QMouseEvent* e) #if QT_VERSION >= 0x040000 cap.modifiers = e->modifiers(); cap.button = e->button(); - cap.buttonsBefore = (QtMouseButtons)(e->buttons() & ~(e->button())); + cap.buttonsBefore = (Qt::MouseButtons)(e->buttons() & ~(e->button())); #else - cap.modifiers = (QtKeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); - cap.button = (QtMouseButtons)((e->stateAfter() & Qt::MouseButtonMask) & (~(e->state() & Qt::MouseButtonMask))); - cap.buttonsBefore = (QtMouseButtons)(e->state() & Qt::MouseButtonMask); + cap.modifiers = (Qt::KeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); + cap.button = (Qt::MouseButtons)((e->stateAfter() & Qt::MouseButtonMask) & (~(e->state() & Qt::MouseButtonMask))); + cap.buttonsBefore = (Qt::MouseButtons)(e->state() & Qt::MouseButtonMask); #endif if (clickBinding_.contains(cap)) @@ -1667,7 +1661,7 @@ void QGLViewer::wheelEvent(QWheelEvent* e) { if (mouseGrabberIsAManipulatedFrame_) { - for (QMap::ConstIterator it=wheelBinding_.begin(), end=wheelBinding_.end(); it!=end; ++it) + for (QMap::ConstIterator it=wheelBinding_.begin(), end=wheelBinding_.end(); it!=end; ++it) if (it.value().handler == FRAME) { ManipulatedFrame* mf = dynamic_cast(mouseGrabber()); @@ -1692,9 +1686,9 @@ void QGLViewer::wheelEvent(QWheelEvent* e) { //#CONNECTION# mousePressEvent has the same structure #if QT_VERSION >= 0x040000 - const QtKeyboardModifiers modifiers = e->modifiers(); + const Qt::KeyboardModifiers modifiers = e->modifiers(); #else - const QtKeyboardModifiers modifiers = e->state(); + const Qt::KeyboardModifiers modifiers = e->state(); #endif if (wheelBinding_.contains(modifiers)) { @@ -1740,11 +1734,11 @@ void QGLViewer::mouseDoubleClickEvent(QMouseEvent* e) #if QT_VERSION >= 0x040000 cap.modifiers = e->modifiers(); cap.button = e->button(); - cap.buttonsBefore = (QtMouseButtons)(e->buttons() & ~(e->button())); + cap.buttonsBefore = (Qt::MouseButtons)(e->buttons() & ~(e->button())); #else - cap.modifiers = (QtKeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); - cap.button = (QtMouseButtons)((e->stateAfter() & Qt::MouseButtonMask) & (~(e->state() & Qt::MouseButtonMask))); - cap.buttonsBefore = (QtMouseButtons)(e->state() & Qt::MouseButtonMask); + cap.modifiers = (Qt::KeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); + cap.button = (Qt::MouseButtons)((e->stateAfter() & Qt::MouseButtonMask) & (~(e->state() & Qt::MouseButtonMask))); + cap.buttonsBefore = (Qt::MouseButtons)(e->state() & Qt::MouseButtonMask); #endif if (clickBinding_.contains(cap)) performClickAction(clickBinding_[cap], e); @@ -1841,7 +1835,7 @@ void QGLViewer::setMouseGrabberIsEnabled(const qglviewer::MouseGrabber* const mo disabledMouseGrabbers_[reinterpret_cast(mouseGrabber)]; } -static QString keyboardModifiersString(QtKeyboardModifiers m, bool noButton=false) +static QString keyboardModifiersString(Qt::KeyboardModifiers m, bool noButton=false) { #if QT_VERSION >= 0x040000 if (noButton && (m==Qt::NoModifier)) @@ -1876,7 +1870,7 @@ static QString keyboardModifiersString(QtKeyboardModifiers m, bool noButton=fals return QString(); } -static QString mouseButtonsString(QtMouseButtons b) +static QString mouseButtonsString(Qt::MouseButtons b) { QString result(""); bool addAmpersand = false; @@ -1939,8 +1933,8 @@ QString QGLViewer::formatClickActionPrivate(ClickActionPrivate cap) /*! Provides a custom mouse binding description, displayed in the help() window Mouse tab. -\p state is a combination of QtKeyboardModifiers (\c Qt::ControlModifier, \c Qt::AltModifier, \c -Qt::ShiftModifier, \c Qt::MetaModifier) and QtMouseButtons (\c Qt::LeftButton, \c Qt::MidButton and +\p state is a combination of Qt::KeyboardModifiers (\c Qt::ControlModifier, \c Qt::AltModifier, \c +Qt::ShiftModifier, \c Qt::MetaModifier) and Qt::MouseButtons (\c Qt::LeftButton, \c Qt::MidButton and \c Qt::RightButton), combined using the \c "|" bitwise operator or simply "+". One can also use the shorter \c Qt::ALT, \c Qt::CTRL, \c Qt::SHIFT or \c QT::META. @@ -1971,11 +1965,11 @@ examples above (\c Qt::ControlButton, \c Qt::AltButton, ...). \note If you use Qt version 2 or 3, the \p buttonsBefore parameter type is actually a Qt::ButtonState. */ -void QGLViewer::setMouseBindingDescription(int state, QString description, bool doubleClick, QtMouseButtons buttonsBefore) +void QGLViewer::setMouseBindingDescription(int state, QString description, bool doubleClick, Qt::MouseButtons buttonsBefore) { ClickActionPrivate cap; - cap.modifiers = QtKeyboardModifiers(convertToKeyboardModifiers(state) & Qt::KeyboardModifierMask); - cap.button = QtMouseButtons(state & Qt::MouseButtonMask); + cap.modifiers = Qt::KeyboardModifiers(convertToKeyboardModifiers(state) & Qt::KeyboardModifierMask); + cap.button = Qt::MouseButtons(state & Qt::MouseButtonMask); cap.doubleClick = doubleClick; cap.buttonsBefore = buttonsBefore; @@ -2047,7 +2041,7 @@ QString QGLViewer::mouseString() const // Then concatenates the descriptions of wheelBinding_, mouseBinding_ and clickBinding_. // The order is significant and corresponds to the priorities set in mousePressEvent() (reverse priority order, last one overwrites previous) // #CONNECTION# mousePressEvent() order - for (QMap::ConstIterator itw=wheelBinding_.begin(), endw=wheelBinding_.end(); itw != endw; ++itw) + for (QMap::ConstIterator itw=wheelBinding_.begin(), endw=wheelBinding_.end(); itw != endw; ++itw) { ClickActionPrivate cap; cap.doubleClick = false; @@ -2076,8 +2070,8 @@ QString QGLViewer::mouseString() const { ClickActionPrivate cap; cap.doubleClick = false; - cap.modifiers = QtKeyboardModifiers(itmb.key() & Qt::KeyboardModifierMask); - cap.button = QtMouseButtons(itmb.key() & Qt::MouseButtonMask); + cap.modifiers = Qt::KeyboardModifiers(itmb.key() & Qt::KeyboardModifierMask); + cap.button = Qt::MouseButtons(itmb.key() & Qt::MouseButtonMask); cap.buttonsBefore = Qt::NoButton; QString text = mouseActionString(itmb.value().action); @@ -2140,9 +2134,13 @@ void QGLViewer::setKeyDescription(int key, QString description) static QString keyString(int key) { #if QT_VERSION >= 0x030000 - return QString(QKeySequence(convertToShortModifier(key))); +# if QT_VERSION >= 0x040100 + return QKeySequence(convertToShortModifier(key)).toString(); +# else + return QString(QKeySequence(convertToShortModifier(key))); +# endif #else - // #CONNECTION# setKeyDescription. In Qt 2.3, longs modifier overlap with key codes. + // #CONNECTION# setKeyDescription. In Qt 2.3, long modifiers overlap with key codes. return QString(QKeySequence(key)); #endif } @@ -2264,7 +2262,7 @@ QString QGLViewer::keyboardString() const // 3 - KeyboardAction bindings description - for (QMap::ConstIterator it=keyboardBinding_.begin(), end=keyboardBinding_.end(); it != end; ++it) + for (QMap::ConstIterator it=keyboardBinding_.begin(), end=keyboardBinding_.end(); it != end; ++it) if ((it.value() != 0) && ((!cameraIsInRevolveMode()) || ((it.key() != INCREASE_FLYSPEED) && (it.key() != DECREASE_FLYSPEED)))) keyDescription[it.value()] = keyboardActionDescription_[it.key()]; @@ -2446,13 +2444,14 @@ void QGLViewer::keyPressEvent(QKeyEvent *e) const Qt::Key key = Qt::Key(e->key()); #if QT_VERSION >= 0x040000 - const QtKeyboardModifiers modifiers = e->modifiers(); + const Qt::KeyboardModifiers modifiers = e->modifiers(); #else - const QtKeyboardModifiers modifiers = (QtKeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); + const Qt::KeyboardModifiers modifiers = (Qt::KeyboardModifiers)(e->state() & Qt::KeyboardModifierMask); #endif - QMap::ConstIterator it=keyboardBinding_.begin(), end=keyboardBinding_.end(); - while ((it != end) && (it.value() != (key | modifiers))) + QMap::ConstIterator it=keyboardBinding_.begin(), end=keyboardBinding_.end(); + const unsigned int target = key | modifiers; + while ((it != end) && (it.value() != target)) ++it; if (it != end) @@ -2584,7 +2583,7 @@ Here are some examples: setShortcut(EXIT_VIEWER, Qt::Key_Q); // Alt+M toggles camera mode -setShortcut(CAMERA_MODE, Qt::ALT+Qt::Key_M); +setShortcut(CAMERA_MODE, Qt::ALT + Qt::Key_M); // The DISPLAY_FPS action is disabled setShortcut(DISPLAY_FPS, 0); @@ -2593,14 +2592,14 @@ setShortcut(DISPLAY_FPS, 0); Only one shortcut can be assigned to a given QGLViewer::KeyboardAction (new bindings replace previous ones). If several KeyboardAction are binded to the same shortcut, only one of them is active. */ -void QGLViewer::setShortcut(KeyboardAction action, int key) +void QGLViewer::setShortcut(KeyboardAction action, unsigned int key) { keyboardBinding_[action] = convertToKeyboardModifiers(key); } /*! Returns the keyboard shortcut associated to a given QGLViewer::KeyboardAction. -Result is an \c int defined using Qt enumerated values, as in \c Qt::Key_Q or +Result is an \c unsigned \c int defined using Qt enumerated values, as in \c Qt::Key_Q or \c Qt::CTRL + Qt::Key_X. Use Qt::MODIFIER_MASK to separate the key from the state keys. Returns \c 0 if the KeyboardAction is disabled (not binded). Set using setShortcut(). @@ -2613,7 +2612,7 @@ tab. See the keyboard page for details and default values and the keyboardAndMouse example for a practical illustration. */ -int QGLViewer::shortcut(KeyboardAction action) const +unsigned int QGLViewer::shortcut(KeyboardAction action) const { if (keyboardBinding_.contains(action)) return convertToShortModifier(keyboardBinding_[action]); @@ -2680,13 +2679,13 @@ void QGLViewer::setPathKey(int key, int index) } /*! Sets the playPathKeyboardModifiers() value. */ -void QGLViewer::setPlayPathKeyboardModifiers(QtKeyboardModifiers modifiers) +void QGLViewer::setPlayPathKeyboardModifiers(Qt::KeyboardModifiers modifiers) { playPathKeyboardModifiers_ = convertKeyboardModifiers(modifiers); } /*! Sets the addKeyFrameKeyboardModifiers() value. */ -void QGLViewer::setAddKeyFrameKeyboardModifiers(QtKeyboardModifiers modifiers) +void QGLViewer::setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers modifiers) { addKeyFrameKeyboardModifiers_ = convertKeyboardModifiers(modifiers); } @@ -2704,7 +2703,7 @@ See also playPathKeyboardModifiers(). \note If you use Qt version 2 or 3, the \c Qt::KeyboardModifiers is actually a \c Qt::ButtonState. The \c Modifier postfix is replaced by \c Button in the enums' names (\c Qt::ControlButton, \c Qt::AltButton, ...). */ -QtKeyboardModifiers QGLViewer::addKeyFrameKeyboardModifiers() const +Qt::KeyboardModifiers QGLViewer::addKeyFrameKeyboardModifiers() const { return addKeyFrameKeyboardModifiers_; } @@ -2721,19 +2720,19 @@ See also addKeyFrameKeyboardModifiers(). \note If you use Qt version 2 or 3, the \c Qt::KeyboardModifiers is actually a \c Qt::ButtonState. The \c Modifier postfix is replaced by \c Button in the enums' names (\c Qt::ControlButton, \c Qt::AltButton, ...). */ -QtKeyboardModifiers QGLViewer::playPathKeyboardModifiers() const +Qt::KeyboardModifiers QGLViewer::playPathKeyboardModifiers() const { return playPathKeyboardModifiers_; } #ifndef DOXYGEN // Deprecated methods -QtKeyboardModifiers QGLViewer::addKeyFrameStateKey() const +Qt::KeyboardModifiers QGLViewer::addKeyFrameStateKey() const { qWarning("addKeyFrameStateKey has been renamed addKeyFrameKeyboardModifiers"); return addKeyFrameKeyboardModifiers(); } -QtKeyboardModifiers QGLViewer::playPathStateKey() const +Qt::KeyboardModifiers QGLViewer::playPathStateKey() const { qWarning("playPathStateKey has been renamed playPathKeyboardModifiers"); return playPathKeyboardModifiers(); @@ -2742,13 +2741,13 @@ QtKeyboardModifiers QGLViewer::playPathStateKey() const void QGLViewer::setAddKeyFrameStateKey(int buttonState) { qWarning("setAddKeyFrameStateKey has been renamed setAddKeyFrameKeyboardModifiers"); - setAddKeyFrameKeyboardModifiers(QtKeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); + setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); } void QGLViewer::setPlayPathStateKey(int buttonState) { qWarning("setPlayPathStateKey has been renamed setPlayPathKeyboardModifiers"); - setPlayPathKeyboardModifiers(QtKeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); + setPlayPathKeyboardModifiers(Qt::KeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); } Qt::Key QGLViewer::keyFrameKey(int index) const @@ -2757,7 +2756,7 @@ Qt::Key QGLViewer::keyFrameKey(int index) const return pathKey(index); } -QtKeyboardModifiers QGLViewer::playKeyFramePathStateKey() const +Qt::KeyboardModifiers QGLViewer::playKeyFramePathStateKey() const { qWarning("playKeyFramePathStateKey has been renamed playPathKeyboardModifiers."); return playPathKeyboardModifiers(); @@ -2772,7 +2771,7 @@ void QGLViewer::setKeyFrameKey(int index, int key) void QGLViewer::setPlayKeyFramePathStateKey(int buttonState) { qWarning("setPlayKeyFramePathStateKey has been renamed setPlayPathKeyboardModifiers."); - setPlayPathKeyboardModifiers(QtKeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); + setPlayPathKeyboardModifiers(Qt::KeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); } #endif @@ -2820,14 +2819,14 @@ setHandlerKeyboardModifiers(QGLViewer::FRAME, Qt::NoModifier); \note If you use Qt version 2 or 3, \p modifiers is actually a \c Qt::ButtonState. The \c Modifier sufix is replaced by \c Button in the enums' names (\c Qt::ControlButton, \c Qt::AltButton, \c Qt::ShiftButton and \c Qt::MetaButton). */ -void QGLViewer::setHandlerKeyboardModifiers(MouseHandler handler, QtKeyboardModifiers modifiers) +void QGLViewer::setHandlerKeyboardModifiers(MouseHandler handler, Qt::KeyboardModifiers modifiers) { QMap newMouseBinding; - QMap newWheelBinding; + QMap newWheelBinding; QMap newClickBinding_; QMap::Iterator mit; - QMap::Iterator wit; + QMap::Iterator wit; // First copy unchanged bindings. for (mit = mouseBinding_.begin(); mit != mouseBinding_.end(); ++mit) @@ -2850,7 +2849,7 @@ void QGLViewer::setHandlerKeyboardModifiers(MouseHandler handler, QtKeyboardModi for (wit = wheelBinding_.begin(); wit != wheelBinding_.end(); ++wit) if (wit.value().handler == handler) { - QtKeyboardModifiers newState = modifiers; + Qt::KeyboardModifiers newState = modifiers; newWheelBinding[newState] = wit.value(); } @@ -2879,13 +2878,13 @@ void QGLViewer::setHandlerKeyboardModifiers(MouseHandler handler, QtKeyboardModi void QGLViewer::setHandlerStateKey(MouseHandler handler, int buttonState) { qWarning("setHandlerStateKey has been renamed setHandlerKeyboardModifiers"); - setHandlerKeyboardModifiers(handler, QtKeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); + setHandlerKeyboardModifiers(handler, Qt::KeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); } void QGLViewer::setMouseStateKey(MouseHandler handler, int buttonState) { qWarning("setMouseStateKey has been renamed setHandlerKeyboardModifiers."); - setHandlerKeyboardModifiers(handler, QtKeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); + setHandlerKeyboardModifiers(handler, Qt::KeyboardModifiers(buttonState & Qt::KeyboardModifierMask)); } #endif @@ -2949,16 +2948,23 @@ void QGLViewer::setMouseBinding(int state, MouseHandler handler, MouseAction act mouseBinding_.insert(state, map); ClickActionPrivate cap; - cap.modifiers = QtKeyboardModifiers(state & Qt::KeyboardModifierMask); - cap.button = QtMouseButtons(state & Qt::MouseButtonMask); + cap.modifiers = Qt::KeyboardModifiers(state & Qt::KeyboardModifierMask); + cap.button = Qt::MouseButtons(state & Qt::MouseButtonMask); cap.doubleClick = false; cap.buttonsBefore = Qt::NoButton; clickBinding_.remove(cap); } } + /*! Associates a ClickAction to any mouse buttons and keyboard modifiers combination. + This method has been deprecated in version 3. + Use setMouseBinding(Qt::KeyboardModifiers, Qt::MouseButtons, ClickAction, bool, Qt::MouseButtons) instead. + Replace the int \p state by a combination of Qt::KeyboardModifiers and Qt::MouseButtons. + + For instance + The parameters should read: when the \p state mouse button(s) is (are) pressed (possibly with Alt, Control or Shift modifiers or any combination of these), and possibly with a \p doubleClick, perform \p action. @@ -2975,7 +2981,7 @@ illustration. The binding is ignored if no mouse button is specified in \p state. \note If you use Qt version 2 or 3, the \p buttonsBefore parameter is actually a Qt::ButtonState. */ -void QGLViewer::setMouseBinding(int state, ClickAction action, bool doubleClick, QtMouseButtons buttonsBefore) +void QGLViewer::setMouseBinding(int state, ClickAction action, bool doubleClick, Qt::MouseButtons buttonsBefore) { if ((buttonsBefore != Qt::NoButton) && !doubleClick) qWarning("Buttons before is only meaningful when doubleClick is true in setMouseBinding()."); @@ -2986,8 +2992,8 @@ void QGLViewer::setMouseBinding(int state, ClickAction action, bool doubleClick, { ClickActionPrivate cap; state = convertToKeyboardModifiers(state); - cap.modifiers = QtKeyboardModifiers(state & Qt::KeyboardModifierMask); - cap.button = QtMouseButtons(state & Qt::MouseButtonMask); + cap.modifiers = Qt::KeyboardModifiers(state & Qt::KeyboardModifierMask); + cap.button = Qt::MouseButtons(state & Qt::MouseButtonMask); cap.doubleClick = doubleClick; cap.buttonsBefore = buttonsBefore; clickBinding_.remove(cap); @@ -3011,7 +3017,7 @@ QGLViewer::CAMERA can receive QGLViewer::ZOOM and QGLViewer::MOVE_FORWARD. The difference between QGLViewer::ZOOM and QGLViewer::MOVE_FORWARD is that QGLViewer::ZOOM speed depends on the distance to the object, while QGLViewer::MOVE_FORWARD moves at a constant speed defined by qglviewer::Camera::flySpeed(). */ -void QGLViewer::setWheelBinding(QtKeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint) +void QGLViewer::setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint) { //#CONNECTION# ManipulatedFrame::wheelEvent and ManipulatedCameraFrame::wheelEvent switches if ((action != ZOOM) && (action != MOVE_FORWARD) && (action != MOVE_BACKWARD) && (action != NO_MOUSE_ACTION)) @@ -3111,7 +3117,7 @@ int QGLViewer::mouseButtonState(MouseHandler handler, MouseAction action, bool w \note If you use Qt version 2 or 3, \p modifiers is actually a \c Qt::ButtonState. The \c Modifier postfix is replaced by \c Button in the enums' names (\c Qt::ControlButton, \c Qt::AltButton, Qt::ShiftButton, Qt::MetaButton). */ -QGLViewer::MouseAction QGLViewer::wheelAction(QtKeyboardModifiers modifiers) const +QGLViewer::MouseAction QGLViewer::wheelAction(Qt::KeyboardModifiers modifiers) const { modifiers = convertKeyboardModifiers(modifiers); if (wheelBinding_.contains(modifiers)) @@ -3121,7 +3127,7 @@ QGLViewer::MouseAction QGLViewer::wheelAction(QtKeyboardModifiers modifiers) con } /*! Same as mouseHandler() but for the wheel action. See also wheelAction(). */ -int QGLViewer::wheelHandler(QtKeyboardModifiers modifiers) const +int QGLViewer::wheelHandler(Qt::KeyboardModifiers modifiers) const { modifiers = convertKeyboardModifiers(modifiers); if (wheelBinding_.contains(modifiers)) @@ -3136,7 +3142,7 @@ int QGLViewer::wheelHandler(QtKeyboardModifiers modifiers) const withConstraint combination (mouseButtonState() would return Qt::NoButton instead). */ int QGLViewer::wheelButtonState(MouseHandler handler, MouseAction action, bool withConstraint) const { - for (QMap::ConstIterator it=wheelBinding_.begin(), end=wheelBinding_.end(); it!=end; ++it) + for (QMap::ConstIterator it=wheelBinding_.begin(), end=wheelBinding_.end(); it!=end; ++it) if ( (it.value().handler == handler) && (it.value().action == action) && (it.value().withConstraint == withConstraint) ) return it.key(); @@ -3144,11 +3150,11 @@ int QGLViewer::wheelButtonState(MouseHandler handler, MouseAction action, bool w } /*! Same as mouseAction(), but for the ClickAction set using setMouseBinding(). */ -QGLViewer::ClickAction QGLViewer::clickAction(int state, bool doubleClick, QtMouseButtons buttonsBefore) const +QGLViewer::ClickAction QGLViewer::clickAction(int state, bool doubleClick, Qt::MouseButtons buttonsBefore) const { ClickActionPrivate cap; - cap.modifiers = QtKeyboardModifiers(convertToKeyboardModifiers(state) & Qt::KeyboardModifierMask); - cap.button = QtMouseButtons(state & Qt::MouseButtonMask); + cap.modifiers = Qt::KeyboardModifiers(convertToKeyboardModifiers(state) & Qt::KeyboardModifierMask); + cap.button = Qt::MouseButtons(state & Qt::MouseButtonMask); cap.doubleClick = doubleClick; cap.buttonsBefore = buttonsBefore; if (clickBinding_.contains(cap)) @@ -3162,7 +3168,7 @@ QGLViewer::ClickAction QGLViewer::clickAction(int state, bool doubleClick, QtMou The results of the query are returned in the \p state, \p doubleClick and \p buttonsBefore parameters. If the ClickAction is not associated to any mouse button, \c Qt::NoButton is returned in \p state. If several mouse buttons trigger in the ClickAction, one of them is returned. */ -void QGLViewer::getClickButtonState(ClickAction ca, int& state, bool& doubleClick, QtMouseButtons& buttonsBefore) const +void QGLViewer::getClickButtonState(ClickAction ca, int& state, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const { for (QMap::ConstIterator it=clickBinding_.begin(), end=clickBinding_.end(); it != end; ++it) if (it.value() == ca) @@ -3206,7 +3212,7 @@ void QGLViewer::toggleCameraMode() bs = mouseButtonState(CAMERA, ROTATE); else bs = mouseButtonState(CAMERA, MOVE_FORWARD); - QtKeyboardModifiers modifiers = QtKeyboardModifiers(bs & Qt::KeyboardModifierMask); + Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(bs & Qt::KeyboardModifierMask); //#CONNECTION# setDefaultMouseBindings() if (revolveMode) diff --git a/octovis/src/extern/QGLViewer/qglviewer.cw b/octovis/src/extern/QGLViewer/qglviewer.cw deleted file mode 100644 index 36c48857..00000000 --- a/octovis/src/extern/QGLViewer/qglviewer.cw +++ /dev/null @@ -1,95 +0,0 @@ - - - - QGLViewer -
QGLViewer/qglviewer.h
- - 400 - 300 - - 0 - - 7 - 7 - - - 789c5d56db521d3b0e7dcf5750d15b6a4aa7dbee76db35350f845b200142eec9a979902f1d20dcd9248153f3efe3ad65381ce82a6aaf962ccbd2d272fff162e5cbdbdd95177f3cbb5ec8e228ada443b95a79916f4e4f6ffffcef7ffe7af6bc1f577ab7d24ffd8a79feaf67cfa9baacec9d9f9525e0b547e060f108d075053497e5a39e4e71ae4f529c9ed873c3d543f1e513fb4ec3f54fe37f573c3fd8371bbeb70f0feb351ef19378570ff920dfdb8613f2a3aef9a739aa3ff693fa2896fb7ce22c8a4f1e30fcbfb478b19db7fb27a623c5d51bf9c9eb86fd3ca93fecd3ec1a7eafd8d4c7aaff4fc5beda9dda4f5b7e23b05cb6fd86e67fd8b0993bc5dfdb7a330fba7e577198ed3c2afefc705eaff9aeb5f399a2f56552dc9554709e77cdde15d4fb25f22f65eed5fff609de58e252ff66d00ae7b7f551cc1fdafe01f524ece74a2cda2fd1f3965c42db7fa7adefb15e2e14f7c537fb6fc5e37d3de8f001eb79e993c64b458af6934e9add36ff6fedbc5d417d6f14a75cb2d687355ee973869db75bbc5082fa47d43f878cf36a3fb3c95d413d0e1a0ee01369fdcb54e3c17ed3e2a70c7ebf512c7505f8c82d1f9bc0bff516cf16d453e731f749b2e6c3ca9f2cb96bf9607e724a0978bfe198b0ffa4fe293bf49767d4e7de4ebfd43ed5f3207ed0fc4ccd1ffd3b57ec92cb8877a6eb876423f8857e8ec924cce7b8c4359b82f3b2ce738c696af3b507bed60142bf71de2edaa8fce682798941307f3de62b26d178b20ffe45dfb0f2b30cd10af8bbd0fd72ac29a81dfc7771143d1f7dd4fc6ccc09fdd7fea62c11f9f01df6171f747e45f52ef6b5bda807f42e4a68f66df04b0660563ec612fbac98a057494cd0f351403fa58be0efd61207176cc35abf1acd04d4f35871aa58eda2fc4931580ffdd1f948bd4f1eebf7c09f1004fa68916f08cd1e9bddb57ab816df0af8a07c0d93cf09f97f407e7e065fe40af3eb2bc5353fd50f1f8389e897209e371e7cda6af15352bd22ad57f03e259d17be403f6bb9c1871fd037ef279d5f567d49a3b701eba10fd17b87793a6ef98e19fc79a5b8da23f800fe8877cd5fe387eca5f92b5f829966f08db4ff699ae680f93f83ff3478f41ff32355e0d10fc5719c6a0715eb3c85e2b2c3fa3bccdf641ce647edd1b83c819fb82fcc6446e887de3fd1bb2a80eaaffa95baa9f3e0d757b5d7ebc343afa0d79d0b03d6ebbc8b75cea37ee8ff746f67d54799c6ecd03f9d87d04f9270bfe8bc87610c13eaf316faeccc00fe1ee0fcae1fc007e55b2a63a5acdad7d19f2ac0c85ff91aede85b3cbfc4cbea45f46355ed53dd0ffaa07c9630dcd757fb53e6b1b3d037d53f378d5d443f946f7118eb878e62ad8fc421363ee9fd18dd602cea013deb86be87fe0af4617006fdc37d350e83c17eba5e64b00efecaafec6c825db4fec5d6f1017f36509fa1eb510fe58f94a177e89ff26faa84b3d08f0df0cf84b61ef5169b7accab07bfede0d01fad570ed6c02ed7b86f2ac6f9353f6b8d057f44f5ca75a61f70ffa9befacec808bc89fcccd4eb7cc916f4d14c1df47b15fa6e5287fe35fdb5a643fec7e05ffd3c01bf0cf8626d87fb017a3ed9bed3fd08765f31ecf8dea9e7013e583c7e98583872aabf32179e1f7bf0773ee4233ee61f7cc2a7159ff1395fc0832ff9aafebfe605dff04ffec5bff9b6e23b5ee5979ae51aaff3066ff216bfe26ddee1d7fc8677abc71eeff35bdcebfc8edff307fec89ff8337fe1affc8dbbead1b3613069e0911d4fec3910139150a49a29652ad4be75e9908ee8987ed0497d7f4a6774becc8d2ee892aed4e39a1674433fe917fda65bbaa3557a593dd7689d36681367a12d7a45dbb443afe90dedd2deb21ab44f6fe980de358ff7f4813ed227fa4c5fe82b7dab6f3aeac990e5745f311a68244713790a7c79b01096ca6a89078bbf6b2af523a37e46cdf2bdfe3e942339961f72f20f8f53399373b9a8bf2ee54aae652137cbf78ffb223fe597fc965bb9935579296b74fdd4a3faaccb866cca96bc926dd9c1bb271eafe58decca9eec2f33681efffbf7b3ff03e2d71717 - - FPSIsDisplayedChanged(bool displayed) - animateNeeded() - axisIsDrawnChanged(bool drawn) - cameraIsEditedChanged(bool edited) - drawFinished(bool automatic) - drawNeeded() - gridIsDrawnChanged(bool drawn) - helpRequired() - mouseGrabberChanged(qglviewer::MouseGrabber *mouseGrabber) - pointSelected(QMouseEvent *e) - stereoChanged(bool on) - textIsEnabledChanged(bool enabled) - viewerInitialized() - aboutQGLViewer() - animate() - copyBufferToTexture(GLint internalFormat, GLenum format) - help() - initFromDOMElement(QDomElement &element) - openSnapshotFormatDialog() - resize(int width, int height) - restoreStateFromFile() - saveSnapshot(QString &fileName, bool overwrite) - saveSnapshot(bool automatic, bool overwrite) - saveStateToFile() - select(QMouseEvent *event) - select(QPoint &point) - setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers modifiers) - setAnimationPeriod(int period) - setAxisIsDrawn(bool draw) - setBackgroundColor(QColor &color) - setCamera(qglviewer::Camera *camera) - setCameraIsEdited(bool edit) - setFPSIsDisplayed(bool display) - setForegroundColor(QColor &color) - setFullScreen(bool fullScreen) - setGridIsDrawn(bool draw) - setHandlerKeyboardModifiers(MouseHandler handler, Qt::KeyboardModifiers modifiers) - setKeyDescription(int key, QString description) - setManipulatedFrame(qglviewer::ManipulatedFrame *frame) - setMouseBinding(int state, ClickAction action, bool doubleClick, Qt::MouseButtons buttonsBefore) - setMouseBinding(int state, MouseHandler handler, MouseAction action, bool withConstraint) - setMouseBindingDescription(int state, QString description, bool doubleClick, Qt::MouseButtons buttonsBefore) - setMouseGrabber(qglviewer::MouseGrabber *mouseGrabber) - setMouseTracking(bool enable) - setPathKey(int key, int index) - setPlayPathKeyboardModifiers(Qt::KeyboardModifiers modifiers) - setSceneBoundingBox(qglviewer::Vec &min, qglviewer::Vec &max) - setSceneCenter(qglviewer::Vec &center) - setSceneRadius(float radius) - setSelectBufferSize(int size) - setSelectRegionHeight(int height) - setSelectRegionWidth(int width) - setSelectedName(int id) - setShortcut(KeyboardAction action, int key) - setSnapshotCounter(int counter) - setSnapshotFileName(QString &name) - setSnapshotFormat(QString &format) - setSnapshotQuality(int quality) - setStateFileName(QString &name) - setStereoDisplay(bool stereo) - setTextIsEnabled(bool enable) - setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint) - showEntireScene() - startAnimation() - stopAnimation() - toggleAnimation() - toggleAxisIsDrawn() - toggleCameraIsEdited() - toggleCameraMode() - toggleFPSIsDisplayed() - toggleFullScreen() - toggleGridIsDrawn() - toggleStereoDisplay() - toggleTextIsEnabled() - setAutoBufferSwap(bool on) -
-
-
diff --git a/octovis/src/extern/QGLViewer/qglviewer.h b/octovis/src/extern/QGLViewer/qglviewer.h index b4ca4e2a..0e715610 100644 --- a/octovis/src/extern/QGLViewer/qglviewer.h +++ b/octovis/src/extern/QGLViewer/qglviewer.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -39,13 +39,10 @@ namespace qglviewer { class MouseGrabber; } -#if QT_VERSION >= 0x040000 -// Qt::ButtonState was split into Qt::KeyboardModifiers and Qt::MouseButtons in Qt 4. -# define QtKeyboardModifiers Qt::KeyboardModifiers -# define QtMouseButtons Qt::MouseButtons -#else -# define QtKeyboardModifiers Qt::ButtonState -# define QtMouseButtons Qt::ButtonState +#if QT_VERSION < 0x040000 +# define Qt::KeyboardModifiers Qt::ButtonState +# define Qt::MouseButtons Qt::ButtonState +# define Qt::WindowFlags Qt::WFlags #endif /*! \brief A versatile 3D OpenGL viewer based on QGLWidget. @@ -78,15 +75,15 @@ class QGLVIEWER_EXPORT QGLViewer : public QGLWidget // Complete implementation is provided so that the constructor is defined with QT3_SUPPORT when .h is included. // (Would not be available otherwise since lib is compiled without QT3_SUPPORT). #if QT_VERSION < 0x040000 || defined QT3_SUPPORT - explicit QGLViewer(QWidget* parent=NULL, const char* name=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0) + explicit QGLViewer(QWidget* parent=NULL, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0) : QGLWidget(parent, name, shareWidget, flags) { defaultConstructor(); } - explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const char* name=0, const QGLWidget* shareWidget=0,Qt::WFlags flags=0) + explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const char* name=0, const QGLWidget* shareWidget=0,Qt::WindowFlags flags=0) : QGLWidget(format, parent, name, shareWidget, flags) { defaultConstructor(); } - QGLViewer(QGLContext* context, QWidget* parent, const char* name=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0) + QGLViewer(QGLContext* context, QWidget* parent, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0) # if QT_VERSION >= 0x030200 : QGLWidget(context, parent, name, shareWidget, flags) { # else @@ -99,9 +96,9 @@ class QGLVIEWER_EXPORT QGLViewer : public QGLWidget #else - explicit QGLViewer(QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0); - explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0); - explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0); + explicit QGLViewer(QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0); + explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0); + explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0); #endif virtual ~QGLViewer(); @@ -931,22 +928,22 @@ void Viewer::drawWithNames() { MOVE_CAMERA_LEFT, MOVE_CAMERA_RIGHT, MOVE_CAMERA_UP, MOVE_CAMERA_DOWN, INCREASE_FLYSPEED, DECREASE_FLYSPEED, SNAPSHOT_TO_CLIPBOARD }; public: - int shortcut(KeyboardAction action) const; + unsigned int shortcut(KeyboardAction action) const; #ifndef DOXYGEN // QGLViewer 1.x int keyboardAccelerator(KeyboardAction action) const; Qt::Key keyFrameKey(int index) const; - QtKeyboardModifiers playKeyFramePathStateKey() const; + Qt::KeyboardModifiers playKeyFramePathStateKey() const; // QGLViewer 2.0 without Qt4 support - QtKeyboardModifiers addKeyFrameStateKey() const; - QtKeyboardModifiers playPathStateKey() const; + Qt::KeyboardModifiers addKeyFrameStateKey() const; + Qt::KeyboardModifiers playPathStateKey() const; #endif Qt::Key pathKey(int index) const; - QtKeyboardModifiers addKeyFrameKeyboardModifiers() const; - QtKeyboardModifiers playPathKeyboardModifiers() const; + Qt::KeyboardModifiers addKeyFrameKeyboardModifiers() const; + Qt::KeyboardModifiers playPathKeyboardModifiers() const; public Q_SLOTS: - void setShortcut(KeyboardAction action, int key); + void setShortcut(KeyboardAction action, unsigned int key); #ifndef DOXYGEN void setKeyboardAccelerator(KeyboardAction action, int key); #endif @@ -962,8 +959,8 @@ void Viewer::drawWithNames() { virtual void setAddKeyFrameStateKey(int buttonState); #endif virtual void setPathKey(int key, int index = 0); - virtual void setPlayPathKeyboardModifiers(QtKeyboardModifiers modifiers); - virtual void setAddKeyFrameKeyboardModifiers(QtKeyboardModifiers modifiers); + virtual void setPlayPathKeyboardModifiers(Qt::KeyboardModifiers modifiers); + virtual void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers modifiers); //@} @@ -1006,29 +1003,29 @@ void Viewer::drawWithNames() { MouseAction mouseAction(int state) const; int mouseHandler(int state) const; int mouseButtonState(MouseHandler handler, MouseAction action, bool withConstraint=true) const; - ClickAction clickAction(int state, bool doubleClick, QtMouseButtons buttonsBefore) const; - void getClickButtonState(ClickAction action, int& state, bool& doubleClick, QtMouseButtons& buttonsBefore) const; + ClickAction clickAction(int state, bool doubleClick, Qt::MouseButtons buttonsBefore) const; + void getClickButtonState(ClickAction action, int& state, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const; - MouseAction wheelAction(QtKeyboardModifiers modifiers) const; - int wheelHandler(QtKeyboardModifiers modifiers) const; + MouseAction wheelAction(Qt::KeyboardModifiers modifiers) const; + int wheelHandler(Qt::KeyboardModifiers modifiers) const; int wheelButtonState(MouseHandler handler, MouseAction action, bool withConstraint=true) const; - public Q_SLOTS: - void setMouseBinding(int state, MouseHandler handler, MouseAction action, bool withConstraint=true); +public Q_SLOTS: + void setMouseBinding(int state, MouseHandler handler, MouseAction action, bool withConstraint=true); #if QT_VERSION < 0x030000 - // Two slots cannot have the same name or two default parameters with Qt 2.3. + // Two slots cannot have the same name or two default parameters with Qt 2.3. public: #endif - void setMouseBinding(int state, ClickAction action, bool doubleClick=false, QtMouseButtons buttonsBefore=Qt::NoButton); - void setMouseBindingDescription(int state, QString description, bool doubleClick=false, QtMouseButtons buttonsBefore=Qt::NoButton); + void setMouseBinding(int state, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton); #if QT_VERSION < 0x030000 - public Q_SLOTS: +public Q_SLOTS: #endif - void setWheelBinding(QtKeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true); - void setHandlerKeyboardModifiers(MouseHandler handler, QtKeyboardModifiers modifiers); + void setMouseBindingDescription(int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton); + void setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true); + void setHandlerKeyboardModifiers(MouseHandler handler, Qt::KeyboardModifiers modifiers); #ifndef DOXYGEN - void setHandlerStateKey(MouseHandler handler, int buttonState); - void setMouseStateKey(MouseHandler handler, int buttonState); + void setHandlerStateKey(MouseHandler handler, int buttonState); + void setMouseStateKey(MouseHandler handler, int buttonState); #endif private: @@ -1193,12 +1190,12 @@ void Viewer::drawWithNames() { void setDefaultShortcuts(); QString cameraPathKeysString() const; QMap keyboardActionDescription_; - QMap keyboardBinding_; - QMap keyDescription_; + QMap keyboardBinding_; + QMap keyDescription_; // K e y F r a m e s s h o r t c u t s QMap pathIndex_; - QtKeyboardModifiers addKeyFrameKeyboardModifiers_, playPathKeyboardModifiers_; + Qt::KeyboardModifiers addKeyFrameKeyboardModifiers_, playPathKeyboardModifiers_; // B u f f e r T e x t u r e GLuint bufferTextureId_; @@ -1217,10 +1214,10 @@ void Viewer::drawWithNames() { // C l i c k a c t i o n s struct ClickActionPrivate { - QtKeyboardModifiers modifiers; - QtMouseButtons button; + Qt::KeyboardModifiers modifiers; + Qt::MouseButtons button; bool doubleClick; - QtMouseButtons buttonsBefore; // only defined when doubleClick is true + Qt::MouseButtons buttonsBefore; // only defined when doubleClick is true // This sort order in used in mouseString() to displays sorted mouse bindings bool operator<(const ClickActionPrivate& cap) const @@ -1245,7 +1242,7 @@ void Viewer::drawWithNames() { void setDefaultMouseBindings(); void performClickAction(ClickAction ca, const QMouseEvent* const e); QMap mouseBinding_; - QMap wheelBinding_; + QMap wheelBinding_; QMap clickBinding_; // S n a p s h o t s diff --git a/octovis/src/extern/QGLViewer/quaternion.cpp b/octovis/src/extern/QGLViewer/quaternion.cpp index f9ce4886..e4062bbf 100644 --- a/octovis/src/extern/QGLViewer/quaternion.cpp +++ b/octovis/src/extern/QGLViewer/quaternion.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/quaternion.h b/octovis/src/extern/QGLViewer/quaternion.h index a1e4568c..e07870f5 100644 --- a/octovis/src/extern/QGLViewer/quaternion.h +++ b/octovis/src/extern/QGLViewer/quaternion.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/saveSnapshot.cpp b/octovis/src/extern/QGLViewer/saveSnapshot.cpp index bb2a8f89..a29d3f3e 100644 --- a/octovis/src/extern/QGLViewer/saveSnapshot.cpp +++ b/octovis/src/extern/QGLViewer/saveSnapshot.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com @@ -24,7 +24,7 @@ #ifndef NO_VECTORIAL_RENDER # if QT_VERSION >= 0x040000 -# include "ui_VRenderInterface.Qt4.h" +# include "ui_VRenderInterface.h" # else # include # include @@ -34,7 +34,7 @@ #endif #if QT_VERSION >= 0x040000 -# include "ui_ImageInterface.Qt4.h" +# include "ui_ImageInterface.h" #else # include # include @@ -818,7 +818,7 @@ QImage QGLViewer::grabFrameBuffer(bool withAlpha) } else { -#if defined (Q_WS_WIN) +#if defined (Q_OS_WIN) || defined (Q_WS_WIN) res = QImage(w, h, 8); glReadPixels(0, 0, w, h, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, res.bits()); //int palSize = 0; diff --git a/octovis/src/extern/QGLViewer/vec.cpp b/octovis/src/extern/QGLViewer/vec.cpp index 6af95783..790c278b 100644 --- a/octovis/src/extern/QGLViewer/vec.cpp +++ b/octovis/src/extern/QGLViewer/vec.cpp @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com diff --git a/octovis/src/extern/QGLViewer/vec.h b/octovis/src/extern/QGLViewer/vec.h index 4b2e9269..2e3fb5e1 100644 --- a/octovis/src/extern/QGLViewer/vec.h +++ b/octovis/src/extern/QGLViewer/vec.h @@ -1,8 +1,8 @@ /**************************************************************************** - Copyright (C) 2002-2011 Gilles Debunne. All rights reserved. + Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. - This file is part of the QGLViewer library version 2.3.17. + This file is part of the QGLViewer library version 2.4.0. http://www.libqglviewer.com - contact@libqglviewer.com