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
This commit is contained in:
@@ -107,7 +107,13 @@ public:
|
|||||||
typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
|
typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
|
||||||
|
|
||||||
// object types
|
// 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;
|
typedef std::auto_ptr< decimater_t > decimater_o;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// default constructor
|
/// default constructor
|
||||||
DecimaterViewerWidget(QWidget* _parent=0)
|
DecimaterViewerWidget(QWidget* _parent=0)
|
||||||
|
|||||||
@@ -124,7 +124,12 @@ public:
|
|||||||
|
|
||||||
bool bind( osg::GeometryPtr geo )
|
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))
|
return (OpenMesh::Kernel_OSG::bind< mesh_t >( *obj, geo))
|
||||||
? (meshes_.push_back(obj.release()), true)
|
? (meshes_.push_back(obj.release()), true)
|
||||||
|
|||||||
@@ -70,7 +70,14 @@ namespace Decimater {
|
|||||||
template<class Mesh>
|
template<class Mesh>
|
||||||
DecimaterT<Mesh>::DecimaterT(Mesh& _mesh) :
|
DecimaterT<Mesh>::DecimaterT(Mesh& _mesh) :
|
||||||
BaseDecimaterT<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
|
// private vertex properties
|
||||||
mesh_.add_property(collapse_target_);
|
mesh_.add_property(collapse_target_);
|
||||||
@@ -163,7 +170,14 @@ 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 __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
heap_ = std::unique_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
|
#else
|
||||||
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
heap_ = std::auto_ptr<DeciHeap>(new DeciHeap(HI));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
heap_->reserve(mesh_.n_vertices());
|
heap_->reserve(mesh_.n_vertices());
|
||||||
|
|
||||||
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
|
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
|
// initialize heap
|
||||||
HeapInterface HI(mesh_, priority_, heap_position_);
|
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());
|
heap_->reserve(mesh_.n_vertices());
|
||||||
|
|
||||||
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
|
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/Utils/HeapT.hh>
|
||||||
#include <OpenMesh/Tools/Decimater/BaseDecimaterT.hh>
|
#include <OpenMesh/Tools/Decimater/BaseDecimaterT.hh>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//== NAMESPACE ================================================================
|
//== NAMESPACE ================================================================
|
||||||
|
|
||||||
namespace OpenMesh {
|
namespace OpenMesh {
|
||||||
@@ -168,7 +166,11 @@ private: //------------------------------------------------------- private data
|
|||||||
Mesh& mesh_;
|
Mesh& mesh_;
|
||||||
|
|
||||||
// heap
|
// 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
|
// vertex properties
|
||||||
VPropHandleT<HalfedgeHandle> collapse_target_;
|
VPropHandleT<HalfedgeHandle> collapse_target_;
|
||||||
|
|||||||
Reference in New Issue
Block a user