Merge branch 'VisualStudio2013C++11Features' into 'master'
Visual Studio 2013 C++11 Features See merge request !130
This commit is contained in:
@@ -114,7 +114,7 @@ public:
|
|||||||
typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
|
typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
|
||||||
|
|
||||||
// object types
|
// object types
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
typedef std::unique_ptr< decimater_t > decimater_o;
|
typedef std::unique_ptr< decimater_t > decimater_o;
|
||||||
#else
|
#else
|
||||||
typedef std::auto_ptr< decimater_t > decimater_o;
|
typedef std::auto_ptr< decimater_t > decimater_o;
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
bool bind( osg::GeometryPtr geo )
|
bool bind( osg::GeometryPtr geo )
|
||||||
{
|
{
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
std::unique_ptr<mesh_t> obj(new mesh_t);
|
std::unique_ptr<mesh_t> obj(new mesh_t);
|
||||||
#else
|
#else
|
||||||
std::auto_ptr<mesh_t> obj(new mesh_t);
|
std::auto_ptr<mesh_t> obj(new mesh_t);
|
||||||
|
|||||||
@@ -851,7 +851,7 @@ compute_screen_space_error(VHierarchyNodeHandle node_handle, VHierarchyNodeHandl
|
|||||||
Vec3f residual;
|
Vec3f residual;
|
||||||
Vec3f res;
|
Vec3f res;
|
||||||
Vec3f lp;
|
Vec3f lp;
|
||||||
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) )
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) )
|
||||||
// Workaround for internal compiler error
|
// Workaround for internal compiler error
|
||||||
Vec3f tri[3]{ {},{},{} };
|
Vec3f tri[3]{ {},{},{} };
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class GenericIteratorT {
|
|||||||
return cpy;
|
return cpy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
||||||
template<class T = value_handle>
|
template<class T = value_handle>
|
||||||
auto operator+=(int amount) ->
|
auto operator+=(int amount) ->
|
||||||
typename std::enable_if<
|
typename std::enable_if<
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
|
|
||||||
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__))
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__))
|
||||||
#define OM_HAS_HASH
|
#define OM_HAS_HASH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ protected:
|
|||||||
virtual int sync()
|
virtual int sync()
|
||||||
{
|
{
|
||||||
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
std::lock_guard<std::mutex> lck (serializer_);
|
std::lock_guard<std::mutex> lck (serializer_);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ protected:
|
|||||||
char c = traits_type::to_char_type(_c);
|
char c = traits_type::to_char_type(_c);
|
||||||
|
|
||||||
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lck (serializer_);
|
std::lock_guard<std::mutex> lck (serializer_);
|
||||||
buffer_.push_back(c);
|
buffer_.push_back(c);
|
||||||
@@ -264,7 +264,7 @@ private:
|
|||||||
bool enabled_;
|
bool enabled_;
|
||||||
|
|
||||||
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
std::mutex serializer_;
|
std::mutex serializer_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public:
|
|||||||
* In C++11 an beyond we can introduce more efficient and more legible
|
* In C++11 an beyond we can introduce more efficient and more legible
|
||||||
* implementations of the following methods.
|
* implementations of the following methods.
|
||||||
*/
|
*/
|
||||||
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
||||||
/**
|
/**
|
||||||
* Reserves space for \p _n elements in all property vectors.
|
* Reserves space for \p _n elements in all property vectors.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace OpenMesh {
|
|||||||
*/
|
*/
|
||||||
template<typename PROPTYPE, typename MeshT>
|
template<typename PROPTYPE, typename MeshT>
|
||||||
class PropertyManager {
|
class PropertyManager {
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
public:
|
public:
|
||||||
PropertyManager(const PropertyManager&) = delete;
|
PropertyManager(const PropertyManager&) = delete;
|
||||||
PropertyManager& operator=(const PropertyManager&) = delete;
|
PropertyManager& operator=(const PropertyManager&) = delete;
|
||||||
@@ -167,7 +167,7 @@ class PropertyManager {
|
|||||||
|
|
||||||
MeshT &getMesh() const { return *mesh_; }
|
MeshT &getMesh() const { return *mesh_; }
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
/// Only for pre C++11 compatibility.
|
/// Only for pre C++11 compatibility.
|
||||||
|
|
||||||
typedef PropertyManager<PROPTYPE, MeshT> Proxy;
|
typedef PropertyManager<PROPTYPE, MeshT> Proxy;
|
||||||
@@ -410,7 +410,7 @@ class PropertyManager {
|
|||||||
(*this)[*begin] = value;
|
(*this)[*begin] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
template<typename HandleTypeIteratorRange, typename PROP_VALUE>
|
template<typename HandleTypeIteratorRange, typename PROP_VALUE>
|
||||||
void set_range(const HandleTypeIteratorRange &range,
|
void set_range(const HandleTypeIteratorRange &range,
|
||||||
const PROP_VALUE &value) {
|
const PROP_VALUE &value) {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ template<class Mesh>
|
|||||||
DecimaterT<Mesh>::DecimaterT(Mesh& _mesh) :
|
DecimaterT<Mesh>::DecimaterT(Mesh& _mesh) :
|
||||||
BaseDecimaterT<Mesh>(_mesh),
|
BaseDecimaterT<Mesh>(_mesh),
|
||||||
mesh_(_mesh),
|
mesh_(_mesh),
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
heap_(nullptr)
|
heap_(nullptr)
|
||||||
#else
|
#else
|
||||||
heap_(NULL)
|
heap_(NULL)
|
||||||
@@ -178,7 +178,7 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
|||||||
// initialize heap
|
// initialize heap
|
||||||
HeapInterface HI(mesh_, priority_, heap_position_);
|
HeapInterface HI(mesh_, priority_, heap_position_);
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
|
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
#else
|
#else
|
||||||
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
@@ -282,7 +282,7 @@ size_t DecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
|
|||||||
|
|
||||||
// initialize heap
|
// initialize heap
|
||||||
HeapInterface HI(mesh_, priority_, heap_position_);
|
HeapInterface HI(mesh_, priority_, heap_position_);
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
|
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
#else
|
#else
|
||||||
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ private: //------------------------------------------------------- private data
|
|||||||
Mesh& mesh_;
|
Mesh& mesh_;
|
||||||
|
|
||||||
// heap
|
// heap
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
|
||||||
std::unique_ptr<DeciHeap> heap_;
|
std::unique_ptr<DeciHeap> heap_;
|
||||||
#else
|
#else
|
||||||
std::auto_ptr<DeciHeap> heap_;
|
std::auto_ptr<DeciHeap> heap_;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
#include "Config.hh"
|
#include "Config.hh"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <OpenMesh/Core/System/omstream.hh>
|
#include <OpenMesh/Core/System/omstream.hh>
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
/// Constructor
|
/// Constructor
|
||||||
HeapT() : HeapVector() {}
|
HeapT() : HeapVector() {}
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
/// Construct with a given \c HeapIterface.
|
/// Construct with a given \c HeapIterface.
|
||||||
HeapT(HeapInterface _interface)
|
HeapT(HeapInterface _interface)
|
||||||
: HeapVector(), interface_(std::move(_interface))
|
: HeapVector(), interface_(std::move(_interface))
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ update_viewing_configurations()
|
|||||||
Vec3f trans;
|
Vec3f trans;
|
||||||
|
|
||||||
// Workaround for internal compiler error on Visual Studio 2015 Update 1
|
// Workaround for internal compiler error on Visual Studio 2015 Update 1
|
||||||
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) )
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) )
|
||||||
Vec3f inv_rot[3]{ {},{},{} };
|
Vec3f inv_rot[3]{ {},{},{} };
|
||||||
Vec3f normal[4]{ {},{},{},{} };
|
Vec3f normal[4]{ {},{},{},{} };
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ void expose_vec(const char *_name) {
|
|||||||
Vector& (Vector::*normalize )(void ) = &Vector::normalize;
|
Vector& (Vector::*normalize )(void ) = &Vector::normalize;
|
||||||
Vector& (Vector::*normalize_cond)(void ) = &Vector::normalize_cond;
|
Vector& (Vector::*normalize_cond)(void ) = &Vector::normalize_cond;
|
||||||
|
|
||||||
#if (_MSC_VER >= 1900 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
#if (_MSC_VER >= 1800 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
||||||
Vector (Vector::*normalized)() const = &Vector::normalized;
|
Vector (Vector::*normalized)() const = &Vector::normalized;
|
||||||
#else
|
#else
|
||||||
const Vector (Vector::*normalized)() const = &Vector::normalized;
|
const Vector (Vector::*normalized)() const = &Vector::normalized;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class OpenMesh_Triangle : public OpenMeshBase {
|
|||||||
* ====================================================================
|
* ====================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ TEST_F(OpenMeshPropertyManager, set_range_bool) {
|
|||||||
ASSERT_TRUE(pm_f_bool[*f_it]);
|
ASSERT_TRUE(pm_f_bool[*f_it]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
/*
|
/*
|
||||||
* Same thing again, this time with C++11 ranges.
|
* Same thing again, this time with C++11 ranges.
|
||||||
*/
|
*/
|
||||||
@@ -137,7 +137,7 @@ TEST_F(OpenMeshPropertyManager, set_range_bool) {
|
|||||||
* C++11 Specific Tests
|
* C++11 Specific Tests
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*/
|
*/
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
|
|
||||||
template<typename PropHandle, typename Mesh>
|
template<typename PropHandle, typename Mesh>
|
||||||
bool has_property(const Mesh& _mesh, const std::string& _name) {
|
bool has_property(const Mesh& _mesh, const std::string& _name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user