Commit 85630a4a authored by Jan Möbius's avatar Jan Möbius

Don't use auto_ptr when compiler supports C++11. Replaced by unique_ptr.



git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1213 fdac6126-5c0c-442c-9429-916003d36597
parent b4883edc
......@@ -107,7 +107,13 @@ public:
typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
// object types
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
typedef std::unique_ptr< decimater_t > decimater_o;
#else
typedef std::auto_ptr< decimater_t > decimater_o;
#endif
/// default constructor
DecimaterViewerWidget(QWidget* _parent=0)
......
......@@ -124,7 +124,12 @@ public:
bool bind( osg::GeometryPtr geo )
{
std::auto_ptr<mesh_t> obj(new mesh_t);
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
std::unique_ptr<mesh_t> obj(new mesh_t);
#else
std::auto_ptr<mesh_t> obj(new mesh_t);
#endif
return (OpenMesh::Kernel_OSG::bind< mesh_t >( *obj, geo))
? (meshes_.push_back(obj.release()), true)
......
......@@ -70,7 +70,14 @@ namespace Decimater {
template<class Mesh>
DecimaterT<Mesh>::DecimaterT(Mesh& _mesh) :
BaseDecimaterT<Mesh>(_mesh),
mesh_(_mesh), heap_(NULL) {
mesh_(_mesh),
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
heap_(nullptr)
#else
heap_(NULL)
#endif
{
// private vertex properties
mesh_.add_property(collapse_target_);
......@@ -163,7 +170,14 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
// initialize heap
HeapInterface HI(mesh_, priority_, heap_position_);
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
#else
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
#endif
heap_->reserve(mesh_.n_vertices());
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
......@@ -258,7 +272,11 @@ size_t DecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
// initialize heap
HeapInterface HI(mesh_, priority_, heap_position_);
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
#else
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
#endif
heap_->reserve(mesh_.n_vertices());
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
......
......@@ -60,8 +60,6 @@
#include <OpenMesh/Tools/Utils/HeapT.hh>
#include <OpenMesh/Tools/Decimater/BaseDecimaterT.hh>
//== NAMESPACE ================================================================
namespace OpenMesh {
......@@ -168,7 +166,11 @@ private: //------------------------------------------------------- private data
Mesh& mesh_;
// heap
std::auto_ptr<DeciHeap> heap_;
#if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
std::unique_ptr<DeciHeap> heap_;
#else
std::auto_ptr<DeciHeap> heap_;
#endif
// vertex properties
VPropHandleT<HalfedgeHandle> collapse_target_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment