replaced boost smart pointers with c++11 smart pointers

pull/850/head
mensinda 2016-04-05 23:23:53 +02:00
parent cff5b0d1a0
commit 5dacda0a08
95 changed files with 709 additions and 712 deletions

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
#include "StringComparison.h"
#include <boost/scoped_array.hpp>
#include <memory>
#include <cctype>
using namespace Assimp;
@ -359,7 +359,7 @@ void Discreet3DSImporter::ConvertMeshes(aiScene* pcOut)
// we need to split all meshes by their materials
for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(); i != mScene->mMeshes.end();++i) {
boost::scoped_array< std::vector<unsigned int> > aiSplit(new std::vector<unsigned int>[mScene->mMaterials.size()]);
std::unique_ptr< std::vector<unsigned int>[] > aiSplit(new std::vector<unsigned int>[mScene->mMaterials.size()]);
name.length = ASSIMP_itoa10(name.data,num++);

View File

@ -150,7 +150,7 @@ namespace {
// Worker function for exporting a scene to 3DS. Prototyped and registered in Exporter.cpp
void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
{
boost::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
std::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
if(!outfile) {
throw DeadlyExportError("Could not open output .3ds file: " + std::string(pFile));
}
@ -181,7 +181,7 @@ void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScen
} // end of namespace Assimp
// ------------------------------------------------------------------------------------------------
Discreet3DSExporter:: Discreet3DSExporter(boost::shared_ptr<IOStream> outfile, const aiScene* scene)
Discreet3DSExporter:: Discreet3DSExporter(std::shared_ptr<IOStream> outfile, const aiScene* scene)
: scene(scene)
, writer(outfile)
{

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_3DSEXPORTER_H_INC
#include <map>
#include <boost/shared_ptr.hpp>
#include <memory>
#include "StreamWriter.h"
#include "./../include/assimp/material.h"
@ -64,7 +64,7 @@ namespace Assimp
class Discreet3DSExporter
{
public:
Discreet3DSExporter(boost::shared_ptr<IOStream> outfile, const aiScene* pScene);
Discreet3DSExporter(std::shared_ptr<IOStream> outfile, const aiScene* pScene);
private:

View File

@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/scene.h"
#include "../include/assimp/config.h"
#include "../include/assimp/IOSystem.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
using namespace Assimp;
@ -708,7 +708,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
// collect all meshes using the same material group.
if (object.subDiv) {
if (configEvalSubdivision) {
boost::scoped_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
std::unique_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
DefaultLogger::get()->info("AC3D: Evaluating subdivision surface: "+object.name);
std::vector<aiMesh*> cpy(meshes.size()-oldm,NULL);
@ -787,7 +787,7 @@ void AC3DImporter::SetupProperties(const Importer* pImp)
void AC3DImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SkeletonMeshBuilder.h"
#include "TargetAnimation.h"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
@ -130,7 +130,7 @@ void ASEImporter::SetupProperties(const Importer* pImp)
void ASEImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "TextureTransform.h"
#include "ConvertToLHProcess.h"
#include "StringUtils.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/anim.h"
#include "../include/assimp/scene.h"
@ -114,7 +114,7 @@ void B3DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
cout<<"Hello world from the B3DImporter!"<<endl;
#endif
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "fast_atof.h"
#include "SkeletonMeshBuilder.h"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include <boost/format.hpp>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -118,7 +118,7 @@ void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSys
mFileName = pFile;
// read file into memory
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
if( file.get() == NULL)
throw DeadlyImportError( "Failed to open file " + pFile + ".");

View File

@ -52,8 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/postprocess.h"
#include <ios>
#include <list>
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <memory>
#include <sstream>
#include <cctype>
@ -149,10 +148,10 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
if (!pIOHandler)
return false;
boost::scoped_ptr<IOStream> pStream (pIOHandler->Open(pFile));
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
if (pStream.get() ) {
// read 200 characters from the file
boost::scoped_array<char> _buffer (new char[searchBytes+1 /* for the '\0' */]);
std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]);
char* buffer = _buffer.get();
if( NULL == buffer ) {
return false;
@ -256,7 +255,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
const uint32_t* magic_u32;
};
magic = reinterpret_cast<const char*>(_magic);
boost::scoped_ptr<IOStream> pStream (pIOHandler->Open(pFile));
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
if (pStream.get() ) {
// skip to offset

View File

@ -268,17 +268,17 @@ void DNA :: DumpToFile()
}
// ------------------------------------------------------------------------------------------------
boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
std::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
const Structure& structure,
const FileDatabase& db
) const
{
std::map<std::string, FactoryPair >::const_iterator it = converters.find(structure.name);
if (it == converters.end()) {
return boost::shared_ptr< ElemBase >();
return std::shared_ptr< ElemBase >();
}
boost::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
std::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
(structure.*((*it).second.second))(ret,db);
return ret;

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StreamReader.h"
#include "../include/assimp/DefaultLogger.hpp"
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <memory>
// enable verbose log output. really verbose, so be careful.
@ -97,7 +97,7 @@ struct ElemBase
* string points is the `c_str` of the `name` attribute of the
* corresponding `Structure`, that is, it is only valid as long
* as the DNA is not modified. The dna_type is only set if the
* data type is not static, i.e. a boost::shared_ptr<ElemBase>
* data type is not static, i.e. a std::shared_ptr<ElemBase>
* in the scene description would have its type resolved
* at runtime, so this member is always set. */
const char* dna_type;
@ -127,7 +127,7 @@ struct FileOffset
// -------------------------------------------------------------------------------
/** Dummy derivate of std::vector to be able to use it in templates simultaenously
* with boost::shared_ptr, which takes only one template argument
* with std::shared_ptr, which takes only one template argument
* while std::vector takes three. Also we need to provide some special member
* functions of shared_ptr */
// -------------------------------------------------------------------------------
@ -260,11 +260,11 @@ public:
// --------------------------------------------------------
// generic converter
template <typename T>
void Convert(boost::shared_ptr<ElemBase> in,const FileDatabase& db) const;
void Convert(std::shared_ptr<ElemBase> in,const FileDatabase& db) const;
// --------------------------------------------------------
// generic allocator
template <typename T> boost::shared_ptr<ElemBase> Allocate() const;
template <typename T> std::shared_ptr<ElemBase> Allocate() const;
@ -282,7 +282,7 @@ public:
// --------------------------------------------------------
// field parsing for pointer or dynamic array types
// (boost::shared_ptr or boost::shared_array)
// (std::shared_ptr)
// The return value indicates whether the data was already cached.
template <int error_policy, template <typename> class TOUT, typename T>
bool ReadFieldPtr(TOUT<T>& out, const char* name,
@ -291,7 +291,7 @@ public:
// --------------------------------------------------------
// field parsing for static arrays of pointer or dynamic
// array types (boost::shared_ptr[] or boost::shared_array[])
// array types (std::shared_ptr[])
// The return value indicates whether the data was already cached.
template <int error_policy, template <typename> class TOUT, typename T, size_t N>
bool ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
@ -318,7 +318,7 @@ private:
const FileDatabase& db, const Field& f, bool) const;
// --------------------------------------------------------
bool ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
bool ResolvePointer( std::shared_ptr< FileOffset >& out, const Pointer & ptrval,
const FileDatabase& db, const Field& f, bool) const;
// --------------------------------------------------------
@ -329,8 +329,8 @@ private:
private:
// ------------------------------------------------------------------------------
template <typename T> T* _allocate(boost::shared_ptr<T>& out, size_t& s) const {
out = boost::shared_ptr<T>(new T());
template <typename T> T* _allocate(std::shared_ptr<T>& out, size_t& s) const {
out = std::shared_ptr<T>(new T());
s = 1;
return out.get();
}
@ -394,7 +394,7 @@ template <> struct Structure :: _defaultInitializer<ErrorPolicy_Fail> {
};
// -------------------------------------------------------------------------------------------------------
template <> inline bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
template <> inline bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(std::shared_ptr<ElemBase>& out,
const Pointer & ptrval,
const FileDatabase& db,
const Field& f,
@ -413,11 +413,11 @@ class DNA
public:
typedef void (Structure::*ConvertProcPtr) (
boost::shared_ptr<ElemBase> in,
std::shared_ptr<ElemBase> in,
const FileDatabase&
) const;
typedef boost::shared_ptr<ElemBase> (
typedef std::shared_ptr<ElemBase> (
Structure::*AllocProcPtr) () const;
typedef std::pair< AllocProcPtr, ConvertProcPtr > FactoryPair;
@ -464,7 +464,7 @@ public:
* @param structure Destination structure definition
* @param db File database.
* @return A null pointer if no appropriate converter is available.*/
boost::shared_ptr< ElemBase > ConvertBlobToStructure(
std::shared_ptr< ElemBase > ConvertBlobToStructure(
const Structure& structure,
const FileDatabase& db
) const;
@ -724,7 +724,7 @@ public:
bool little;
DNA dna;
boost::shared_ptr< StreamReaderAny > reader;
std::shared_ptr< StreamReaderAny > reader;
vector< FileBlockHead > entries;
public:
@ -738,7 +738,7 @@ public:
// arrays of objects are never cached because we can't easily
// ensure their proper destruction.
template <typename T>
ObjectCache<boost::shared_ptr>& cache(boost::shared_ptr<T>& /*in*/) const {
ObjectCache<std::shared_ptr>& cache(std::shared_ptr<T>& /*in*/) const {
return _cache;
}
@ -755,7 +755,7 @@ private:
#endif
mutable ObjectCache<vector> _cacheArrays;
mutable ObjectCache<boost::shared_ptr> _cache;
mutable ObjectCache<std::shared_ptr> _cache;
mutable size_t next_cache_idx;
};

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_AI_BLEND_DNA_INL
#define INCLUDED_AI_BLEND_DNA_INL
#include <boost/shared_ptr.hpp>
#include <memory>
namespace Assimp {
namespace Blender {
@ -83,14 +83,14 @@ const Field& Structure :: operator [] (const size_t i) const
}
//--------------------------------------------------------------------------------
template <typename T> boost::shared_ptr<ElemBase> Structure :: Allocate() const
template <typename T> std::shared_ptr<ElemBase> Structure :: Allocate() const
{
return boost::shared_ptr<T>(new T());
return std::shared_ptr<T>(new T());
}
//--------------------------------------------------------------------------------
template <typename T> void Structure :: Convert(
boost::shared_ptr<ElemBase> in,
std::shared_ptr<ElemBase> in,
const FileDatabase& db) const
{
Convert<T> (*static_cast<T*> ( in.get() ),db);
@ -366,7 +366,7 @@ bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const Fil
//--------------------------------------------------------------------------------
inline bool Structure :: ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
inline bool Structure :: ResolvePointer( std::shared_ptr< FileOffset >& out, const Pointer & ptrval,
const FileDatabase& db,
const Field&,
bool) const
@ -381,7 +381,7 @@ inline bool Structure :: ResolvePointer( boost::shared_ptr< FileOffset >& out, c
// find the file block the pointer is pointing to
const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
out = boost::shared_ptr< FileOffset > (new FileOffset());
out = std::shared_ptr< FileOffset > (new FileOffset());
out->val = block->start+ static_cast<size_t>((ptrval.val - block->address.val) );
return false;
}
@ -426,7 +426,7 @@ bool Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
}
//--------------------------------------------------------------------------------
template <> bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
template <> bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(std::shared_ptr<ElemBase>& out,
const Pointer & ptrval,
const FileDatabase& db,
const Field&,
@ -703,7 +703,7 @@ template <template <typename> class TOUT> template <typename T> void ObjectCache
typename StructureCache::const_iterator it = caches[s.cache_idx].find(ptr);
if (it != caches[s.cache_idx].end()) {
out = boost::static_pointer_cast<T>( (*it).second );
out = std::static_pointer_cast<T>( (*it).second );
#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
++db.stats().cache_hits;
@ -723,7 +723,7 @@ template <template <typename> class TOUT> template <typename T> void ObjectCache
s.cache_idx = db.next_cache_idx++;
caches.resize(db.next_cache_idx);
}
caches[s.cache_idx][ptr] = boost::static_pointer_cast<ElemBase>( out );
caches[s.cache_idx][ptr] = std::static_pointer_cast<ElemBase>( out );
#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
++db.stats().cached_objects;

View File

@ -157,7 +157,7 @@ namespace Blender {
TempArray <std::vector, aiTexture> textures;
// set of all materials referenced by at least one mesh in the scene
std::deque< boost::shared_ptr< Material > > materials_raw;
std::deque< std::shared_ptr< Material > > materials_raw;
// counter to name sentinel textures inserted as substitutes for procedural textures.
unsigned int sentinel_cnt;

View File

@ -164,7 +164,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
#endif
FileDatabase file;
boost::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
std::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
if (!stream) {
ThrowException("Could not open file for reading");
}
@ -190,7 +190,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
// http://www.gzip.org/zlib/rfc-gzip.html#header-trailer
stream->Seek(0L,aiOrigin_SET);
boost::shared_ptr<StreamReaderLE> reader = boost::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
std::shared_ptr<StreamReaderLE> reader = std::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
// build a zlib stream
z_stream zstream;
@ -260,9 +260,9 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
}
// ------------------------------------------------------------------------------------------------
void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStream> stream)
void BlenderImporter::ParseBlendFile(FileDatabase& out, std::shared_ptr<IOStream> stream)
{
out.reader = boost::shared_ptr<StreamReaderAny>(new StreamReaderAny(stream,out.little));
out.reader = std::shared_ptr<StreamReaderAny>(new StreamReaderAny(stream,out.little));
DNAParser dna_reader(out);
const DNA* dna = NULL;
@ -342,7 +342,7 @@ void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileD
// the file. This is terrible. Here, we're first looking for
// all objects which don't have parent objects at all -
std::deque<const Object*> no_parents;
for (boost::shared_ptr<Base> cur = boost::static_pointer_cast<Base> ( in.base.first ); cur; cur = cur->next) {
for (std::shared_ptr<Base> cur = std::static_pointer_cast<Base> ( in.base.first ); cur; cur = cur->next) {
if (cur->object) {
if(!cur->object->parent) {
no_parents.push_back(cur->object.get());
@ -350,7 +350,7 @@ void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileD
else conv.objects.insert(cur->object.get());
}
}
for (boost::shared_ptr<Base> cur = in.basact; cur; cur = cur->next) {
for (std::shared_ptr<Base> cur = in.basact; cur; cur = cur->next) {
if (cur->object) {
if(cur->object->parent) {
conv.objects.insert(cur->object.get());
@ -565,7 +565,7 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
if (index == static_cast<unsigned int>( -1 )) {
// Setup a default material.
boost::shared_ptr<Material> p(new Material());
std::shared_ptr<Material> p(new Material());
ai_assert(::strlen(AI_DEFAULT_MATERIAL_NAME) < sizeof(p->id.name)-2);
strcpy( p->id.name+2, AI_DEFAULT_MATERIAL_NAME );
@ -589,7 +589,7 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
}
}
for(boost::shared_ptr<Material> mat : conv_data.materials_raw) {
for(std::shared_ptr<Material> mat : conv_data.materials_raw) {
// reset per material global counters
for (size_t i = 0; i < sizeof(conv_data.next_texture)/sizeof(conv_data.next_texture[0]);++i) {
@ -749,8 +749,8 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
ThrowException("Material index is out of range");
}
boost::shared_ptr<Material> mat = mesh->mat[it.first];
const std::deque< boost::shared_ptr<Material> >::iterator has = std::find(
std::shared_ptr<Material> mat = mesh->mat[it.first];
const std::deque< std::shared_ptr<Material> >::iterator has = std::find(
conv_data.materials_raw.begin(),
conv_data.materials_raw.end(),mat
);

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BaseImporter.h"
#include "LogAux.h"
#include <boost/shared_ptr.hpp>
#include <memory>
struct aiNode;
struct aiMesh;
@ -133,7 +133,7 @@ protected:
// --------------------
void ParseBlendFile(Blender::FileDatabase& out,
boost::shared_ptr<IOStream> stream
std::shared_ptr<IOStream> stream
);
// --------------------

View File

@ -48,9 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SceneCombiner.h"
#include "Subdivision.h"
#include "../include/assimp/scene.h"
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/pointer_cast.hpp>
#include <memory>
#include <functional>
@ -113,8 +111,8 @@ void BlenderModifierShowcase::ApplyModifiers(aiNode& out, ConversionData& conv_d
// we're allowed to dereference the pointers without risking to crash. We might still be
// invoking UB btw - we're assuming that the ModifierData member of the respective modifier
// structures is at offset sizeof(vftable) with no padding.
const SharedModifierData* cur = boost::static_pointer_cast<const SharedModifierData> ( orig_object.modifiers.first.get() );
for (; cur; cur = boost::static_pointer_cast<const SharedModifierData> ( cur->modifier.next.get() ), ++ful) {
const SharedModifierData* cur = static_cast<const SharedModifierData *> ( orig_object.modifiers.first.get() );
for (; cur; cur = static_cast<const SharedModifierData *> ( cur->modifier.next.get() ), ++ful) {
ai_assert(cur->dna_type);
const Structure* s = conv_data.db.dna.Get( cur->dna_type );
@ -153,7 +151,7 @@ void BlenderModifierShowcase::ApplyModifiers(aiNode& out, ConversionData& conv_d
BlenderModifier* const modifier = *curmod;
if(modifier->IsActive(dat)) {
modifier->DoIt(out,conv_data,*boost::static_pointer_cast<const ElemBase>(cur),in,orig_object);
modifier->DoIt(out,conv_data,*static_cast<const ElemBase *>(cur),in,orig_object);
cnt++;
curgod = NULL;
@ -312,11 +310,11 @@ void BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data
return;
};
boost::scoped_ptr<Subdivider> subd(Subdivider::Create(algo));
std::unique_ptr<Subdivider> subd(Subdivider::Create(algo));
ai_assert(subd);
aiMesh** const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
boost::scoped_array<aiMesh*> tempmeshes(new aiMesh*[out.mNumMeshes]());
std::unique_ptr<aiMesh*[]> tempmeshes(new aiMesh*[out.mNumMeshes]());
subd->Subdivide(meshes,out.mNumMeshes,tempmeshes.get(),std::max( mir.renderLevels, mir.levels ),true);
std::copy(tempmeshes.get(),tempmeshes.get()+out.mNumMeshes,meshes);

View File

@ -64,7 +64,7 @@ template <> void Structure :: Convert<Object> (
ReadFieldArray2<ErrorPolicy_Warn>(dest.parentinv,"parentinv",db);
ReadFieldArray<ErrorPolicy_Warn>(dest.parsubstr,"parsubstr",db);
{
boost::shared_ptr<Object> parent;
std::shared_ptr<Object> parent;
ReadFieldPtr<ErrorPolicy_Warn>(parent,"*parent",db);
dest.parent = parent.get();
}
@ -337,7 +337,7 @@ template <> void Structure :: Convert<MTexPoly> (
{
{
boost::shared_ptr<Image> tpage;
std::shared_ptr<Image> tpage;
ReadFieldPtr<ErrorPolicy_Igno>(tpage,"*tpage",db);
dest.tpage = tpage.get();
}

View File

@ -73,7 +73,7 @@ namespace Blender {
//
// * Pointers to other structures or primitive types are allowed.
// No references or double pointers or arrays of pointers.
// A pointer to a T is normally written as boost::shared_ptr, while a
// A pointer to a T is normally written as std::shared_ptr, while a
// pointer to an array of elements is written as boost::
// shared_array. To avoid cyclic pointers, use raw pointers in
// one direction.
@ -98,6 +98,8 @@ struct Object;
struct MTex;
struct Image;
#include <memory>
#define AI_BLEND_MESH_MAX_VERTS 2000000000L
// -------------------------------------------------------------------------------
@ -110,8 +112,8 @@ struct ID : ElemBase {
// -------------------------------------------------------------------------------
struct ListBase : ElemBase {
boost::shared_ptr<ElemBase> first;
boost::shared_ptr<ElemBase> last;
std::shared_ptr<ElemBase> first;
std::shared_ptr<ElemBase> last;
};
@ -119,14 +121,14 @@ struct ListBase : ElemBase {
struct PackedFile : ElemBase {
int size WARN;
int seek WARN;
boost::shared_ptr< FileOffset > data WARN;
std::shared_ptr< FileOffset > data WARN;
};
// -------------------------------------------------------------------------------
struct GroupObject : ElemBase {
boost::shared_ptr<GroupObject> prev,next FAIL;
boost::shared_ptr<Object> ob;
std::shared_ptr<GroupObject> prev,next FAIL;
std::shared_ptr<Object> ob;
};
// -------------------------------------------------------------------------------
@ -134,7 +136,7 @@ struct Group : ElemBase {
ID id FAIL;
int layer;
boost::shared_ptr<GroupObject> gobject;
std::shared_ptr<GroupObject> gobject;
};
// -------------------------------------------------------------------------------
@ -222,7 +224,7 @@ struct MTFace : ElemBase {
short tile;
short unwrap;
// boost::shared_ptr<Image> tpage;
// std::shared_ptr<Image> tpage;
};
// -------------------------------------------------------------------------------
@ -259,12 +261,12 @@ struct Material : ElemBase {
float darkness;
float refrac;
boost::shared_ptr<Group> group;
std::shared_ptr<Group> group;
short diff_shader WARN;
short spec_shader WARN;
boost::shared_ptr<MTex> mtex[18];
std::shared_ptr<MTex> mtex[18];
};
// -------------------------------------------------------------------------------
@ -295,7 +297,7 @@ struct Mesh : ElemBase {
vector<MDeformVert> dvert;
vector<MCol> mcol;
vector< boost::shared_ptr<Material> > mat FAIL;
vector< std::shared_ptr<Material> > mat FAIL;
};
// -------------------------------------------------------------------------------
@ -304,7 +306,7 @@ struct Library : ElemBase {
char name[240] WARN;
char filename[240] FAIL;
boost::shared_ptr<Library> parent WARN;
std::shared_ptr<Library> parent WARN;
};
// -------------------------------------------------------------------------------
@ -444,8 +446,8 @@ struct ModifierData : ElemBase {
eModifierType_ShapeKey
};
boost::shared_ptr<ElemBase> next WARN;
boost::shared_ptr<ElemBase> prev WARN;
std::shared_ptr<ElemBase> next WARN;
std::shared_ptr<ElemBase> prev WARN;
int type, mode;
char name[32];
@ -489,7 +491,7 @@ struct MirrorModifierData : ElemBase {
short axis, flag;
float tolerance;
boost::shared_ptr<Object> mirror_ob;
std::shared_ptr<Object> mirror_ob;
};
// -------------------------------------------------------------------------------
@ -517,11 +519,11 @@ struct Object : ElemBase {
char parsubstr[32] WARN;
Object* parent WARN;
boost::shared_ptr<Object> track WARN;
std::shared_ptr<Object> track WARN;
boost::shared_ptr<Object> proxy,proxy_from,proxy_group WARN;
boost::shared_ptr<Group> dup_group WARN;
boost::shared_ptr<ElemBase> data FAIL;
std::shared_ptr<Object> proxy,proxy_from,proxy_group WARN;
std::shared_ptr<Group> dup_group WARN;
std::shared_ptr<ElemBase> data FAIL;
ListBase modifiers;
};
@ -530,17 +532,17 @@ struct Object : ElemBase {
// -------------------------------------------------------------------------------
struct Base : ElemBase {
Base* prev WARN;
boost::shared_ptr<Base> next WARN;
boost::shared_ptr<Object> object WARN;
std::shared_ptr<Base> next WARN;
std::shared_ptr<Object> object WARN;
};
// -------------------------------------------------------------------------------
struct Scene : ElemBase {
ID id FAIL;
boost::shared_ptr<Object> camera WARN;
boost::shared_ptr<World> world WARN;
boost::shared_ptr<Base> basact WARN;
std::shared_ptr<Object> camera WARN;
std::shared_ptr<World> world WARN;
std::shared_ptr<Base> basact WARN;
ListBase base;
};
@ -564,7 +566,7 @@ struct Image : ElemBase {
//unsigned int bindcode;
//unsigned int *repbind;
boost::shared_ptr<PackedFile> packedfile;
std::shared_ptr<PackedFile> packedfile;
//struct PreviewImage * preview;
float lastupdate;
@ -650,7 +652,7 @@ struct Tex : ElemBase {
//bNodeTree *nodetree;
//Ipo *ipo;
boost::shared_ptr<Image> ima WARN;
std::shared_ptr<Image> ima WARN;
//PluginTex *plugin;
//ColorBand *coba;
//EnvMap *env;
@ -717,8 +719,8 @@ struct MTex : ElemBase {
MapType mapto;
BlendType blendtype;
boost::shared_ptr<Object> object;
boost::shared_ptr<Tex> tex;
std::shared_ptr<Object> object;
std::shared_ptr<Tex> tex;
char uvname[32];
Projection projx,projy,projz;

View File

@ -6,7 +6,7 @@
namespace boost {
// small replacement for boost::scoped_ptr
// small replacement for std::unique_ptr
template <class T>
class scoped_ptr
{

View File

@ -67,7 +67,7 @@ namespace boost {
}
// ------------------------------
// Small replacement for boost::shared_ptr, not threadsafe because no
// Small replacement for std::shared_ptr, not threadsafe because no
// atomic reference counter is in use.
// ------------------------------
template <class T>

View File

@ -131,7 +131,7 @@ void C4DImporter::SetupProperties(const Importer* /*pImp*/)
void C4DImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
if( file.get() == NULL) {
ThrowException("failed to open file " + pFile);

View File

@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "LineSplitter.h"
#include "TinyFormatter.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
@ -141,7 +141,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
COB::Scene scene;
boost::scoped_ptr<StreamReaderLE> stream(new StreamReaderLE( pIOHandler->Open(pFile,"rb")) );
std::unique_ptr<StreamReaderLE> stream(new StreamReaderLE( pIOHandler->Open(pFile,"rb")) );
// check header
char head[32];
@ -167,7 +167,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
}
// sort faces by material indices
for(boost::shared_ptr< Node >& n : scene.nodes) {
for(std::shared_ptr< Node >& n : scene.nodes) {
if (n->type == Node::TYPE_MESH) {
Mesh& mesh = (Mesh&)(*n.get());
for(Face& f : mesh.faces) {
@ -177,7 +177,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
}
// count meshes
for(boost::shared_ptr< Node >& n : scene.nodes) {
for(std::shared_ptr< Node >& n : scene.nodes) {
if (n->type == Node::TYPE_MESH) {
Mesh& mesh = (Mesh&)(*n.get());
if (mesh.vertex_positions.size() && mesh.texture_coords.size()) {
@ -190,7 +190,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
pScene->mNumMeshes = 0;
// count lights and cameras
for(boost::shared_ptr< Node >& n : scene.nodes) {
for(std::shared_ptr< Node >& n : scene.nodes) {
if (n->type == Node::TYPE_LIGHT) {
++pScene->mNumLights;
}
@ -208,7 +208,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
pScene->mNumLights = pScene->mNumCameras = 0;
// resolve parents by their IDs and build the output graph
boost::scoped_ptr<Node> root(new Group());
std::unique_ptr<Node> root(new Group());
for(size_t n = 0; n < scene.nodes.size(); ++n) {
const Node& nn = *scene.nodes[n].get();
if(nn.parent_id==0) {
@ -227,7 +227,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
}
// ------------------------------------------------------------------------------------------------
void ConvertTexture(boost::shared_ptr< Texture > tex, aiMaterial* out, aiTextureType type)
void ConvertTexture(std::shared_ptr< Texture > tex, aiMaterial* out, aiTextureType type)
{
const aiString path( tex->path );
out->AddProperty(&path,AI_MATKEY_TEXTURE(type,0));
@ -298,7 +298,7 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill
break;
}
}
boost::scoped_ptr<const Material> defmat;
std::unique_ptr<const Material> defmat;
if(!min) {
DefaultLogger::get()->debug(format()<<"Could not resolve material index "
<<reflist.first<<" - creating default material for this slot");
@ -644,7 +644,7 @@ void COBImporter::ReadUnit_Ascii(Scene& out, LineSplitter& splitter, const Chunk
// parent chunks preceede their childs, so we should have the
// corresponding chunk already.
for(boost::shared_ptr< Node >& nd : out.nodes) {
for(std::shared_ptr< Node >& nd : out.nodes) {
if (nd->id == nfo.parent_id) {
const unsigned int t=strtoul10(splitter[1]);
@ -673,7 +673,7 @@ void COBImporter::ReadLght_Ascii(Scene& out, LineSplitter& splitter, const Chunk
return UnsupportedChunk_Ascii(splitter,nfo,"Lght");
}
out.nodes.push_back(boost::shared_ptr<Light>(new Light()));
out.nodes.push_back(std::shared_ptr<Light>(new Light()));
Light& msh = (Light&)(*out.nodes.back().get());
msh = nfo;
@ -729,7 +729,7 @@ void COBImporter::ReadCame_Ascii(Scene& out, LineSplitter& splitter, const Chunk
return UnsupportedChunk_Ascii(splitter,nfo,"Came");
}
out.nodes.push_back(boost::shared_ptr<Camera>(new Camera()));
out.nodes.push_back(std::shared_ptr<Camera>(new Camera()));
Camera& msh = (Camera&)(*out.nodes.back().get());
msh = nfo;
@ -747,7 +747,7 @@ void COBImporter::ReadBone_Ascii(Scene& out, LineSplitter& splitter, const Chunk
return UnsupportedChunk_Ascii(splitter,nfo,"Bone");
}
out.nodes.push_back(boost::shared_ptr<Bone>(new Bone()));
out.nodes.push_back(std::shared_ptr<Bone>(new Bone()));
Bone& msh = (Bone&)(*out.nodes.back().get());
msh = nfo;
@ -763,7 +763,7 @@ void COBImporter::ReadGrou_Ascii(Scene& out, LineSplitter& splitter, const Chunk
return UnsupportedChunk_Ascii(splitter,nfo,"Grou");
}
out.nodes.push_back(boost::shared_ptr<Group>(new Group()));
out.nodes.push_back(std::shared_ptr<Group>(new Group()));
Group& msh = (Group&)(*out.nodes.back().get());
msh = nfo;
@ -777,7 +777,7 @@ void COBImporter::ReadPolH_Ascii(Scene& out, LineSplitter& splitter, const Chunk
return UnsupportedChunk_Ascii(splitter,nfo,"PolH");
}
out.nodes.push_back(boost::shared_ptr<Mesh>(new Mesh()));
out.nodes.push_back(std::shared_ptr<Mesh>(new Mesh()));
Mesh& msh = (Mesh&)(*out.nodes.back().get());
msh = nfo;
@ -1033,7 +1033,7 @@ void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const
}
const chunk_guard cn(nfo,reader);
out.nodes.push_back(boost::shared_ptr<Mesh>(new Mesh()));
out.nodes.push_back(std::shared_ptr<Mesh>(new Mesh()));
Mesh& msh = (Mesh&)(*out.nodes.back().get());
msh = nfo;
@ -1223,7 +1223,7 @@ void COBImporter::ReadCame_Binary(COB::Scene& out, StreamReaderLE& reader, const
const chunk_guard cn(nfo,reader);
out.nodes.push_back(boost::shared_ptr<Camera>(new Camera()));
out.nodes.push_back(std::shared_ptr<Camera>(new Camera()));
Camera& msh = (Camera&)(*out.nodes.back().get());
msh = nfo;
@ -1246,7 +1246,7 @@ void COBImporter::ReadLght_Binary(COB::Scene& out, StreamReaderLE& reader, const
const chunk_guard cn(nfo,reader);
out.nodes.push_back(boost::shared_ptr<Light>(new Light()));
out.nodes.push_back(std::shared_ptr<Light>(new Light()));
Light& msh = (Light&)(*out.nodes.back().get());
msh = nfo;
@ -1262,7 +1262,7 @@ void COBImporter::ReadGrou_Binary(COB::Scene& out, StreamReaderLE& reader, const
const chunk_guard cn(nfo,reader);
out.nodes.push_back(boost::shared_ptr<Group>(new Group()));
out.nodes.push_back(std::shared_ptr<Group>(new Group()));
Group& msh = (Group&)(*out.nodes.back().get());
msh = nfo;
@ -1280,7 +1280,7 @@ void COBImporter::ReadUnit_Binary(COB::Scene& out, StreamReaderLE& reader, const
// parent chunks preceede their childs, so we should have the
// corresponding chunk already.
for(boost::shared_ptr< Node >& nd : out.nodes) {
for(std::shared_ptr< Node >& nd : out.nodes) {
if (nd->id == nfo.parent_id) {
const unsigned int t=reader.GetI2();
nd->unit_scale = t>=sizeof(units)/sizeof(units[0])?(

View File

@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_AI_COB_SCENE_H
#define INCLUDED_AI_COB_SCENE_H
#include <boost/shared_ptr.hpp>
#include <memory>
#include <deque>
#include "BaseImporter.h"
@ -237,7 +237,7 @@ struct Material : ChunkInfo
AutoFacet autofacet;
float autofacet_angle;
boost::shared_ptr<Texture> tex_env,tex_bump,tex_color;
std::shared_ptr<Texture> tex_env,tex_bump,tex_color;
};
// ------------------
@ -254,7 +254,7 @@ struct Bitmap : ChunkInfo
std::vector<char> buff_zipped;
};
typedef std::deque< boost::shared_ptr<Node> > NodeList;
typedef std::deque< std::shared_ptr<Node> > NodeList;
typedef std::vector< Material > MaterialList;
// ------------------

View File

@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ParsingUtils.h"
#include "fast_atof.h"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/anim.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -122,7 +122,7 @@ void CSMImporter::SetupProperties(const Importer* pImp)
void CSMImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Exceptional.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include <ctime>
#include <set>
@ -75,7 +75,7 @@ void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* p
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
// we're still here - export successfully completed. Write result to the given IOSYstem
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .dae file: " + std::string(pFile));
}
@ -268,7 +268,7 @@ void ColladaExporter::WriteTextures() {
std::string name = mFile + "_texture_" + (i < 1000 ? "0" : "") + (i < 100 ? "0" : "") + (i < 10 ? "0" : "") + str + "." + ((const char*) texture->achFormatHint);
boost::scoped_ptr<IOStream> outfile(mIOSystem->Open(mPath + name, "wb"));
std::unique_ptr<IOStream> outfile(mIOSystem->Open(mPath + name, "wb"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output texture file: " + mPath + name);
}

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ColladaParser.h"
#include "fast_atof.h"
#include "ParsingUtils.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/light.h"
@ -87,13 +87,13 @@ ColladaParser::ColladaParser( IOSystem* pIOHandler, const std::string& pFile)
}
// open the file
boost::scoped_ptr<IOStream> file( pIOHandler->Open(pFile ) );
std::unique_ptr<IOStream> file( pIOHandler->Open(pFile ) );
if (file.get() == NULL) {
throw DeadlyImportError( "Failed to open file " + pFile + "." );
}
// generate a XML reader for it
boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(file.get()));
std::unique_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(file.get()));
mReader = irr::io::createIrrXMLReader( mIOWrapper.get());
if (!mReader) {
ThrowException("Collada: Unable to open file.");

View File

@ -49,7 +49,7 @@
#include "ColladaHelper.h"
#include "../include/assimp/ai_assert.h"
#include <boost/format.hpp>
#include <boost/scoped_ptr.hpp>
#include <memory>
namespace Assimp
{

View File

@ -213,7 +213,7 @@ struct InsertBlock
// keeps track of all geometry in a single BLOCK.
struct Block
{
std::vector< boost::shared_ptr<PolyLine> > lines;
std::vector< std::shared_ptr<PolyLine> > lines;
std::vector<InsertBlock> insertions;
std::string name;

View File

@ -133,7 +133,7 @@ void DXFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler)
{
boost::shared_ptr<IOStream> file = boost::shared_ptr<IOStream>( pIOHandler->Open( pFile) );
std::shared_ptr<IOStream> file = std::shared_ptr<IOStream>( pIOHandler->Open( pFile) );
// Check whether we can read the file
if( file.get() == NULL) {
@ -222,7 +222,7 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
unsigned int vcount = 0, icount = 0;
for (const DXF::Block& bl : output.blocks) {
for (boost::shared_ptr<const DXF::PolyLine> pl : bl.lines) {
for (std::shared_ptr<const DXF::PolyLine> pl : bl.lines) {
vcount += pl->positions.size();
icount += pl->counts.size();
}
@ -262,7 +262,7 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
ExpandBlockReferences(*entities,blocks_by_name);
unsigned int cur = 0;
for (boost::shared_ptr<const DXF::PolyLine> pl : entities->lines) {
for (std::shared_ptr<const DXF::PolyLine> pl : entities->lines) {
if (pl->positions.size()) {
std::map<std::string, unsigned int>::iterator it = layers.find(pl->layer);
@ -371,8 +371,8 @@ void DXFImporter::ExpandBlockReferences(DXF::Block& bl,const DXF::BlockMap& bloc
// XXX this would be the place to implement recursive expansion if needed.
const DXF::Block& bl_src = *(*it).second;
for (boost::shared_ptr<const DXF::PolyLine> pl_in : bl_src.lines) {
boost::shared_ptr<DXF::PolyLine> pl_out = boost::shared_ptr<DXF::PolyLine>(new DXF::PolyLine(*pl_in));
for (std::shared_ptr<const DXF::PolyLine> pl_in : bl_src.lines) {
std::shared_ptr<DXF::PolyLine> pl_out = std::shared_ptr<DXF::PolyLine>(new DXF::PolyLine(*pl_in));
if (bl_src.base.Length() || insert.scale.x!=1.f || insert.scale.y!=1.f || insert.scale.z!=1.f || insert.angle || insert.pos.Length()) {
// manual coordinate system transformation
@ -617,7 +617,7 @@ void DXFImporter::ParseInsertion(DXF::LineReader& reader, DXF::FileData& output)
// ------------------------------------------------------------------------------------------------
void DXFImporter::ParsePolyLine(DXF::LineReader& reader, DXF::FileData& output)
{
output.blocks.back().lines.push_back( boost::shared_ptr<DXF::PolyLine>( new DXF::PolyLine() ) );
output.blocks.back().lines.push_back( std::shared_ptr<DXF::PolyLine>( new DXF::PolyLine() ) );
DXF::PolyLine& line = *output.blocks.back().lines.back();
unsigned int iguess = 0, vguess = 0;
@ -799,7 +799,7 @@ void DXFImporter::Parse3DFace(DXF::LineReader& reader, DXF::FileData& output)
// (note) this is also used for for parsing line entities, so we
// must handle the vertex_count == 2 case as well.
output.blocks.back().lines.push_back( boost::shared_ptr<DXF::PolyLine>( new DXF::PolyLine() ) );
output.blocks.back().lines.push_back( std::shared_ptr<DXF::PolyLine>( new DXF::PolyLine() ) );
DXF::PolyLine& line = *output.blocks.back().lines.back();
aiVector3D vip[4];

View File

@ -63,7 +63,7 @@ Here we implement only the C++ interface (Assimp::Exporter).
#include "ConvertToLHProcess.h"
#include "Exceptional.h"
#include "ScenePrivate.h"
#include <boost/shared_ptr.hpp>
#include <memory>
#include "../include/assimp/Exporter.hpp"
#include "../include/assimp/mesh.h"
#include "../include/assimp/postprocess.h"
@ -184,7 +184,7 @@ public:
public:
aiExportDataBlob* blob;
boost::shared_ptr< Assimp::IOSystem > mIOSystem;
std::shared_ptr< Assimp::IOSystem > mIOSystem;
bool mIsDefaultIOHandler;
/** Post processing steps we can apply at the imported data. */
@ -254,10 +254,10 @@ const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const
}
boost::shared_ptr<IOSystem> old = pimpl->mIOSystem;
std::shared_ptr<IOSystem> old = pimpl->mIOSystem;
BlobIOSystem* blobio = new BlobIOSystem();
pimpl->mIOSystem = boost::shared_ptr<IOSystem>( blobio );
pimpl->mIOSystem = std::shared_ptr<IOSystem>( blobio );
if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName())) {
pimpl->mIOSystem = old;

View File

@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/scene.h"
#include <boost/tuple/tuple.hpp>
#include <boost/scoped_array.hpp>
#include <memory>
#include <iterator>
#include <sstream>
@ -338,7 +338,7 @@ private:
bool reverse_order = false );
// key (time), value, mapto (component index)
typedef boost::tuple<boost::shared_ptr<KeyTimeList>, boost::shared_ptr<KeyValueList>, unsigned int > KeyFrameList;
typedef boost::tuple<std::shared_ptr<KeyTimeList>, std::shared_ptr<KeyValueList>, unsigned int > KeyFrameList;
typedef std::vector<KeyFrameList> KeyFrameListList;
@ -2951,8 +2951,8 @@ Converter::KeyFrameListList Converter::GetKeyframeList( const std::vector<const
ai_assert( curve->GetKeys().size() == curve->GetValues().size() && curve->GetKeys().size() );
//get values within the start/stop time window
boost::shared_ptr<KeyTimeList> Keys( new KeyTimeList() );
boost::shared_ptr<KeyValueList> Values( new KeyValueList() );
std::shared_ptr<KeyTimeList> Keys( new KeyTimeList() );
std::shared_ptr<KeyValueList> Values( new KeyValueList() );
const int count = curve->GetKeys().size();
Keys->reserve( count );
Values->reserve( count );
@ -3089,7 +3089,7 @@ void Converter::InterpolateKeys( aiQuatKey* valOut, const KeyTimeList& keys, con
ai_assert( keys.size() );
ai_assert( valOut );
boost::scoped_array<aiVectorKey> temp( new aiVectorKey[ keys.size() ] );
std::unique_ptr<aiVectorKey[]> temp( new aiVectorKey[ keys.size() ] );
InterpolateKeys( temp.get(), keys, inputs, def_value, maxTime, minTime );
aiMatrix4x4 m;

View File

@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXDocumentUtil.h"
#include "FBXProperties.h"
#include <boost/make_shared.hpp>
#include <memory>
#include <functional>
@ -248,7 +248,7 @@ Object::~Object()
// ------------------------------------------------------------------------------------------------
FileGlobalSettings::FileGlobalSettings(const Document& doc, boost::shared_ptr<const PropertyTable> props)
FileGlobalSettings::FileGlobalSettings(const Document& doc, std::shared_ptr<const PropertyTable> props)
: props(props)
, doc(doc)
{
@ -358,11 +358,11 @@ void Document::ReadGlobalSettings()
if(!ehead || !ehead->Compound()) {
DOMWarning("no GlobalSettings dictionary found");
globals.reset(new FileGlobalSettings(*this, boost::make_shared<const PropertyTable>()));
globals.reset(new FileGlobalSettings(*this, std::make_shared<const PropertyTable>()));
return;
}
boost::shared_ptr<const PropertyTable> props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true);
std::shared_ptr<const PropertyTable> props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true);
if(!props) {
DOMError("GlobalSettings dictionary contains no property table");
@ -469,8 +469,8 @@ void Document::ReadPropertyTemplates()
const Element* Properties70 = (*sc)["Properties70"];
if(Properties70) {
boost::shared_ptr<const PropertyTable> props = boost::make_shared<const PropertyTable>(
*Properties70,boost::shared_ptr<const PropertyTable>(static_cast<const PropertyTable*>(NULL))
std::shared_ptr<const PropertyTable> props = std::make_shared<const PropertyTable>(
*Properties70,std::shared_ptr<const PropertyTable>(static_cast<const PropertyTable*>(NULL))
);
templates[oname+"."+pname] = props;

View File

@ -118,7 +118,7 @@ public:
private:
const Document& doc;
const Element& element;
boost::scoped_ptr<const Object> object;
std::unique_ptr<const Object> object;
const uint64_t id;
@ -174,7 +174,7 @@ public:
}
private:
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
};
@ -484,7 +484,7 @@ private:
std::string shading;
std::string culling;
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
};
/** DOM class for generic FBX textures */
@ -541,7 +541,7 @@ private:
std::string relativeFileName;
std::string fileName;
std::string alphaSource;
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
unsigned int crop[4];
@ -663,7 +663,7 @@ private:
std::string type;
std::string relativeFileName;
std::string fileName;
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
uint32_t contentLength;
uint8_t* content;
@ -700,7 +700,7 @@ public:
private:
std::string shading;
bool multilayer;
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
TextureMap textures;
LayeredTextureMap layeredTextures;
@ -791,7 +791,7 @@ public:
private:
const Object* target;
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
mutable AnimationCurveMap curves;
std::string prop;
@ -819,7 +819,7 @@ public:
AnimationCurveNodeList Nodes(const char* const * target_prop_whitelist = NULL, size_t whitelist_size = 0) const;
private:
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
const Document& doc;
};
@ -850,7 +850,7 @@ public:
}
private:
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
AnimationLayerList layers;
};
@ -868,7 +868,7 @@ public:
}
private:
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
};
typedef std::vector<float> WeightArray;
@ -1002,7 +1002,7 @@ public:
// up to many thousands of objects (most of which we never use),
// so the memory overhead for them should be kept at a minimum.
typedef std::map<uint64_t, LazyObject*> ObjectMap;
typedef std::fbx_unordered_map<std::string, boost::shared_ptr<const PropertyTable> > PropertyTemplateMap;
typedef std::fbx_unordered_map<std::string, std::shared_ptr<const PropertyTable> > PropertyTemplateMap;
typedef std::multimap<uint64_t, const Connection*> ConnectionMap;
@ -1013,7 +1013,7 @@ typedef std::multimap<uint64_t, const Connection*> ConnectionMap;
class FileGlobalSettings
{
public:
FileGlobalSettings(const Document& doc, boost::shared_ptr<const PropertyTable> props);
FileGlobalSettings(const Document& doc, std::shared_ptr<const PropertyTable> props);
~FileGlobalSettings();
const PropertyTable& Props() const {
@ -1065,7 +1065,7 @@ public:
fbx_simple_property(CustomFrameRate, float, -1.0f)
private:
boost::shared_ptr<const PropertyTable> props;
std::shared_ptr<const PropertyTable> props;
const Document& doc;
};
@ -1174,7 +1174,7 @@ private:
std::vector<uint64_t> animationStacks;
mutable std::vector<const AnimationStack*> animationStacksResolved;
boost::scoped_ptr<FileGlobalSettings> globals;
std::unique_ptr<FileGlobalSettings> globals;
};
} // Namespace FBX

View File

@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXUtil.h"
#include "FBXDocumentUtil.h"
#include "FBXProperties.h"
#include <boost/make_shared.hpp>
namespace Assimp {
namespace FBX {
@ -96,14 +96,14 @@ void DOMWarning(const std::string& message, const Element* element /*= NULL*/)
// ------------------------------------------------------------------------------------------------
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
std::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
const Scope& sc,
bool no_warn /*= false*/)
{
const Element* const Properties70 = sc["Properties70"];
boost::shared_ptr<const PropertyTable> templateProps = boost::shared_ptr<const PropertyTable>(
std::shared_ptr<const PropertyTable> templateProps = std::shared_ptr<const PropertyTable>(
static_cast<const PropertyTable*>(NULL));
if(templateName.length()) {
@ -121,10 +121,10 @@ boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
return templateProps;
}
else {
return boost::make_shared<const PropertyTable>();
return std::make_shared<const PropertyTable>();
}
}
return boost::make_shared<const PropertyTable>(*Properties70,templateProps);
return std::make_shared<const PropertyTable>(*Properties70,templateProps);
}
} // !Util
} // !FBX

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/defs.h"
#include <string>
#include <boost/shared_ptr.hpp>
#include <memory>
#include "FBXDocument.h"
struct Token;
@ -67,7 +67,7 @@ void DOMWarning(const std::string& message, const Element* element = NULL);
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
std::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
const Scope& sc,

View File

@ -142,7 +142,7 @@ void FBXImporter::SetupProperties(const Importer* pImp)
void FBXImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
std::unique_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
if (!stream) {
ThrowException("Could not open file for reading");
}

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
#include <map>
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "LogAux.h"
#include "FBXCompileConfig.h"
@ -105,7 +105,7 @@ private:
const Token& key_token;
TokenList tokens;
boost::scoped_ptr<Scope> compound;
std::unique_ptr<Scope> compound;
};
@ -186,7 +186,7 @@ private:
TokenPtr last, current;
TokenList::const_iterator cursor;
boost::scoped_ptr<Scope> root;
std::unique_ptr<Scope> root;
const bool is_binary;
};

View File

@ -139,7 +139,7 @@ PropertyTable::PropertyTable()
// ------------------------------------------------------------------------------------------------
PropertyTable::PropertyTable(const Element& element, boost::shared_ptr<const PropertyTable> templateProps)
PropertyTable::PropertyTable(const Element& element, std::shared_ptr<const PropertyTable> templateProps)
: templateProps(templateProps)
, element(&element)
{
@ -216,7 +216,7 @@ DirectPropertyMap PropertyTable::GetUnparsedProperties() const
// Read the element's value.
// Wrap the naked pointer (since the call site is required to acquire ownership)
// std::unique_ptr from C++11 would be preferred both as a wrapper and a return value.
boost::shared_ptr<Property> prop = boost::shared_ptr<Property>(ReadTypedProperty(*element.second));
std::shared_ptr<Property> prop = std::shared_ptr<Property>(ReadTypedProperty(*element.second));
// Element could not be read. Skip it.
if (!prop) continue;

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map>
#include "FBXCompileConfig.h"
#include <boost/shared_ptr.hpp>
#include <memory>
namespace Assimp {
namespace FBX {
@ -97,7 +97,7 @@ private:
};
typedef std::fbx_unordered_map<std::string,boost::shared_ptr<Property> > DirectPropertyMap;
typedef std::fbx_unordered_map<std::string,std::shared_ptr<Property> > DirectPropertyMap;
typedef std::fbx_unordered_map<std::string,const Property*> PropertyMap;
typedef std::fbx_unordered_map<std::string,const Element*> LazyPropertyMap;
@ -109,7 +109,7 @@ class PropertyTable
public:
// in-memory property table with no source element
PropertyTable();
PropertyTable(const Element& element, boost::shared_ptr<const PropertyTable> templateProps);
PropertyTable(const Element& element, std::shared_ptr<const PropertyTable> templateProps);
~PropertyTable();
public:
@ -129,7 +129,7 @@ public:
private:
LazyPropertyMap lazyProps;
mutable PropertyMap props;
const boost::shared_ptr<const PropertyTable> templateProps;
const std::shared_ptr<const PropertyTable> templateProps;
const Element* const element;
};

View File

@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_AI_FBX_TOKENIZER_H
#define INCLUDED_AI_FBX_TOKENIZER_H
#include <boost/shared_ptr.hpp>
#include <memory>
#include "FBXCompileConfig.h"
#include "../include/assimp/ai_assert.h"
#include <vector>

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FindInstancesProcess.h"
#include <boost/scoped_array.hpp>
#include <memory>
#include <stdio.h>
using namespace Assimp;
@ -126,8 +126,8 @@ void FindInstancesProcess::Execute( aiScene* pScene)
// have several thousand small meshes. That's too much for a brute
// everyone-against-everyone check involving up to 10 comparisons
// each.
boost::scoped_array<uint64_t> hashes (new uint64_t[pScene->mNumMeshes]);
boost::scoped_array<unsigned int> remapping (new unsigned int[pScene->mNumMeshes]);
std::unique_ptr<uint64_t[]> hashes (new uint64_t[pScene->mNumMeshes]);
std::unique_ptr<unsigned int[]> remapping (new unsigned int[pScene->mNumMeshes]);
unsigned int numMeshesOut = 0;
for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
@ -219,8 +219,8 @@ void FindInstancesProcess::Execute( aiScene* pScene)
// For completeness ... compare even the index buffers for equality
// face order & winding order doesn't care. Input data is in verbose format.
boost::scoped_array<unsigned int> ftbl_orig(new unsigned int[orig->mNumVertices]);
boost::scoped_array<unsigned int> ftbl_inst(new unsigned int[orig->mNumVertices]);
std::unique_ptr<unsigned int[]> ftbl_orig(new unsigned int[orig->mNumVertices]);
std::unique_ptr<unsigned int[]> ftbl_inst(new unsigned int[orig->mNumVertices]);
for (unsigned int tt = 0; tt < orig->mNumFaces;++tt) {
aiFace& f = orig->mFaces[tt];

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// internal headers
#include "HMPLoader.h"
#include "MD2FileData.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
@ -114,7 +114,7 @@ void HMPImporter::InternReadFile( const std::string& pFile,
{
pScene = _pScene;
pIOHandler = _pIOHandler;
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -413,7 +413,7 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const IfcPolygonalBounded
n.Normalize();
// obtain the polygonal bounding volume
boost::shared_ptr<TempMesh> profile = boost::shared_ptr<TempMesh>(new TempMesh());
std::shared_ptr<TempMesh> profile = std::shared_ptr<TempMesh>(new TempMesh());
if(!ProcessCurve(hs->PolygonalBoundary, *profile.get(), conv)) {
IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace");
return;
@ -730,10 +730,10 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T
// operand should be near-planar. Luckily, this is usually the case in Ifc
// buildings.
boost::shared_ptr<TempMesh> meshtmp = boost::shared_ptr<TempMesh>(new TempMesh());
std::shared_ptr<TempMesh> meshtmp = std::shared_ptr<TempMesh>(new TempMesh());
ProcessExtrudedAreaSolid(*as,*meshtmp,conv,false);
std::vector<TempOpening> openings(1, TempOpening(as,IfcVector3(0,0,0),meshtmp,boost::shared_ptr<TempMesh>()));
std::vector<TempOpening> openings(1, TempOpening(as,IfcVector3(0,0,0),meshtmp,std::shared_ptr<TempMesh>()));
result = first_operand;

View File

@ -229,7 +229,7 @@ private:
class CompositeCurve : public BoundedCurve
{
typedef std::pair< boost::shared_ptr< BoundedCurve >, bool > CurveEntry;
typedef std::pair< std::shared_ptr< BoundedCurve >, bool > CurveEntry;
public:
@ -241,8 +241,8 @@ public:
curves.reserve(entity.Segments.size());
for(const IfcCompositeCurveSegment& curveSegment :entity.Segments) {
// according to the specification, this must be a bounded curve
boost::shared_ptr< Curve > cv(Curve::Convert(curveSegment.ParentCurve,conv));
boost::shared_ptr< BoundedCurve > bc = boost::dynamic_pointer_cast<BoundedCurve>(cv);
std::shared_ptr< Curve > cv(Curve::Convert(curveSegment.ParentCurve,conv));
std::shared_ptr< BoundedCurve > bc = std::dynamic_pointer_cast<BoundedCurve>(cv);
if (!bc) {
IFCImporter::LogError("expected segment of composite curve to be a bounded curve");
@ -346,9 +346,9 @@ public:
TrimmedCurve(const IfcTrimmedCurve& entity, ConversionData& conv)
: BoundedCurve(entity,conv)
{
base = boost::shared_ptr<const Curve>(Curve::Convert(entity.BasisCurve,conv));
base = std::shared_ptr<const Curve>(Curve::Convert(entity.BasisCurve,conv));
typedef boost::shared_ptr<const STEP::EXPRESS::DataType> Entry;
typedef std::shared_ptr<const STEP::EXPRESS::DataType> Entry;
// for some reason, trimmed curves can either specify a parametric value
// or a point on the curve, or both. And they can even specify which of the
@ -446,7 +446,7 @@ private:
IfcFloat maxval;
bool agree_sense;
boost::shared_ptr<const Curve> base;
std::shared_ptr<const Curve> base;
};

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../contrib/poly2tri/poly2tri/poly2tri.h"
#include "../contrib/clipper/clipper.hpp"
#include <boost/make_shared.hpp>
#include <memory>
#include <iterator>
@ -170,7 +170,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m
opening.extrusionDir = master_normal;
opening.solid = NULL;
opening.profileMesh = boost::make_shared<TempMesh>();
opening.profileMesh = std::make_shared<TempMesh>();
opening.profileMesh->verts.reserve(*iit);
opening.profileMesh->vertcnt.push_back(*iit);
@ -660,10 +660,10 @@ void ProcessExtrudedArea(const IfcExtrudedAreaSolid& solid, const TempMesh& curv
// it was created from. Return an empty mesh to the caller.
if( collect_openings && !result.IsEmpty() ) {
ai_assert(conv.collect_openings);
boost::shared_ptr<TempMesh> profile = boost::shared_ptr<TempMesh>(new TempMesh());
std::shared_ptr<TempMesh> profile = std::shared_ptr<TempMesh>(new TempMesh());
profile->Swap(result);
boost::shared_ptr<TempMesh> profile2D = boost::shared_ptr<TempMesh>(new TempMesh());
std::shared_ptr<TempMesh> profile2D = std::shared_ptr<TempMesh>(new TempMesh());
profile2D->verts.insert(profile2D->verts.end(), in.begin(), in.end());
profile2D->vertcnt.push_back(in.size());
conv.collect_openings->push_back(TempOpening(&solid, dir, profile, profile2D));
@ -732,9 +732,9 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, unsigned int matid,
ConversionData& conv)
{
bool fix_orientation = false;
boost::shared_ptr< TempMesh > meshtmp = boost::make_shared<TempMesh>();
std::shared_ptr< TempMesh > meshtmp = std::make_shared<TempMesh>();
if(const IfcShellBasedSurfaceModel* shellmod = geo.ToPtr<IfcShellBasedSurfaceModel>()) {
for(boost::shared_ptr<const IfcShell> shell :shellmod->SbsmBoundary) {
for(std::shared_ptr<const IfcShell> shell :shellmod->SbsmBoundary) {
try {
const EXPRESS::ENTITY& e = shell->To<ENTITY>();
const IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To<IfcConnectedFaceSet>();
@ -791,7 +791,7 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, unsigned int matid,
conv.collect_openings->push_back(TempOpening(geo.ToPtr<IfcSolidModel>(),
IfcVector3(0,0,0),
meshtmp,
boost::shared_ptr<TempMesh>()));
std::shared_ptr<TempMesh>()));
}
return true;
}

View File

@ -168,7 +168,7 @@ void IFCImporter::SetupProperties(const Importer* pImp)
void IFCImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::shared_ptr<IOStream> stream(pIOHandler->Open(pFile));
std::shared_ptr<IOStream> stream(pIOHandler->Open(pFile));
if (!stream) {
ThrowException("Could not open file for reading");
}
@ -233,7 +233,7 @@ void IFCImporter::InternReadFile( const std::string& pFile,
#endif
}
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
std::unique_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
const STEP::HeaderInfo& head = static_cast<const STEP::DB&>(*db).GetHeader();
if(!head.fileSchema.size() || head.fileSchema.substr(0,3) != "IFC") {

View File

@ -76,7 +76,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat
mat->AddProperty(&name,AI_MATKEY_NAME);
// now see which kinds of surface information are present
for(boost::shared_ptr< const IFC::IfcSurfaceStyleElementSelect > sel2 : surf->Styles) {
for(std::shared_ptr< const IFC::IfcSurfaceStyleElementSelect > sel2 : surf->Styles) {
if (const IFC::IfcSurfaceStyleShading* shade = sel2->ResolveSelectPtr<IFC::IfcSurfaceStyleShading>(conv.db)) {
aiColor4D col_base,col;
@ -140,7 +140,7 @@ unsigned int ProcessMaterials(uint64_t id, unsigned int prevMatId, ConversionDat
for(;range.first != range.second; ++range.first) {
if(const IFC::IfcStyledItem* const styled = conv.db.GetObject((*range.first).second)->ToPtr<IFC::IfcStyledItem>()) {
for(const IFC::IfcPresentationStyleAssignment& as : styled->Styles) {
for(boost::shared_ptr<const IFC::IfcPresentationStyleSelect> sel : as.Styles) {
for(std::shared_ptr<const IFC::IfcPresentationStyleSelect> sel : as.Styles) {
if( const IFC::IfcSurfaceStyle* const surf = sel->ResolveSelectPtr<IFC::IfcSurfaceStyle>(conv.db) ) {
// try to satisfy from cache

View File

@ -65,7 +65,7 @@ void ProcessPolyLine(const IfcPolyline& def, TempMesh& meshout, ConversionData&
// ------------------------------------------------------------------------------------------------
bool ProcessCurve(const IfcCurve& curve, TempMesh& meshout, ConversionData& conv)
{
boost::scoped_ptr<const Curve> cv(Curve::Convert(curve,conv));
std::unique_ptr<const Curve> cv(Curve::Convert(curve,conv));
if (!cv) {
IFCImporter::LogWarn("skipping unknown IfcCurve entity, type is " + curve.GetClassName());
return false;

File diff suppressed because it is too large Load Diff

View File

@ -120,8 +120,8 @@ struct TempOpening
const IFC::IfcSolidModel* solid;
IfcVector3 extrusionDir;
boost::shared_ptr<TempMesh> profileMesh;
boost::shared_ptr<TempMesh> profileMesh2D;
std::shared_ptr<TempMesh> profileMesh;
std::shared_ptr<TempMesh> profileMesh2D;
// list of points generated for this opening. This is used to
// create connections between two opposing holes created
@ -140,8 +140,8 @@ struct TempOpening
// ------------------------------------------------------------------------------
TempOpening(const IFC::IfcSolidModel* solid,IfcVector3 extrusionDir,
boost::shared_ptr<TempMesh> profileMesh,
boost::shared_ptr<TempMesh> profileMesh2D)
std::shared_ptr<TempMesh> profileMesh,
std::shared_ptr<TempMesh> profileMesh2D)
: solid(solid)
, extrusionDir(extrusionDir)
, profileMesh(profileMesh)

View File

@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// We need boost::common_factor to compute the lcm/gcd of a number
#include <boost/math/common_factor_rt.hpp>
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/mesh.h"
#include "../include/assimp/material.h"
@ -902,7 +902,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
void IRRImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "IRRMeshLoader.h"
#include "ParsingUtils.h"
#include "fast_atof.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/mesh.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -121,7 +121,7 @@ const aiImporterDesc* IRRMeshImporter::GetInfo () const
void IRRMeshImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -77,7 +77,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Exceptional.h"
#include "Profiler.h"
#include <set>
#include <boost/scoped_ptr.hpp>
#include <memory>
#include <cctype>
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
@ -612,7 +612,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
return NULL;
}
boost::scoped_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
std::unique_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
if (profiler) {
profiler->BeginRegion("total");
}
@ -785,7 +785,7 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags)
}
#endif // ! DEBUG
boost::scoped_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
std::unique_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
BaseProcess* process = pimpl->mPostProcessingSteps[a];
@ -880,7 +880,7 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
}
#endif // ! DEBUG
boost::scoped_ptr<Profiler> profiler( GetPropertyInteger( AI_CONFIG_GLOB_MEASURE_TIME, 0 ) ? new Profiler() : NULL );
std::unique_ptr<Profiler> profiler( GetPropertyInteger( AI_CONFIG_GLOB_MEASURE_TIME, 0 ) ? new Profiler() : NULL );
if ( profiler ) {
profiler->BeginRegion( "postprocess" );

View File

@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ByteSwapper.h"
#include "ProcessHelper.h"
#include "ConvertToLHProcess.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include <sstream>
#include <iomanip>
@ -139,7 +139,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
#include "../include/assimp/IOSystem.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
using namespace Assimp;
@ -511,7 +511,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler)
{
io = pIOHandler;
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "MD2NormalTable.h" // shouldn't be included by other units
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -217,7 +217,7 @@ void MD2Importer::ValidateHeader( )
void MD2Importer::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ParsingUtils.h"
#include "Importer.h"
#include "../include/assimp/DefaultLogger.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/material.h"
#include "../include/assimp/scene.h"
@ -108,7 +108,7 @@ Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
// Load a Quake 3 shader
bool Q3Shader::LoadShader(ShaderData& fill, const std::string& pFile,IOSystem* io)
{
boost::scoped_ptr<IOStream> file( io->Open( pFile, "rt"));
std::unique_ptr<IOStream> file( io->Open( pFile, "rt"));
if (!file.get())
return false; // if we can't access the file, don't worry and return
@ -233,7 +233,7 @@ bool Q3Shader::LoadShader(ShaderData& fill, const std::string& pFile,IOSystem* i
// Load a Quake 3 skin
bool Q3Shader::LoadSkin(SkinData& fill, const std::string& pFile,IOSystem* io)
{
boost::scoped_ptr<IOStream> file( io->Open( pFile, "rt"));
std::unique_ptr<IOStream> file( io->Open( pFile, "rt"));
if (!file.get())
return false; // if we can't access the file, don't worry and return
@ -745,7 +745,7 @@ void MD3Importer::InternReadFile( const std::string& pFile,
return;
}
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SkeletonMeshBuilder.h"
#include "../include/assimp/Importer.hpp"
#include "../include/assimp/scene.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
@ -354,7 +354,7 @@ void MD5Importer::AttachChilds_Anim(int iParentID,aiNode* piParent, AnimBoneList
void MD5Importer::LoadMD5MeshFile ()
{
std::string pFile = mFile + "md5mesh";
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL || !file->FileSize()) {
@ -569,7 +569,7 @@ void MD5Importer::LoadMD5MeshFile ()
void MD5Importer::LoadMD5AnimFile ()
{
std::string pFile = mFile + "md5anim";
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( !file.get() || !file->FileSize()) {
@ -681,7 +681,7 @@ void MD5Importer::LoadMD5AnimFile ()
void MD5Importer::LoadMD5CameraFile ()
{
std::string pFile = mFile + "md5camera";
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( !file.get() || !file->FileSize()) {

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "MDCNormalTable.h" // shouldn't be included by other units
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -219,7 +219,7 @@ void MDCImporter::SetupProperties(const Importer* pImp)
void MDCImporter::InternReadFile(
const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)

View File

@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "MD2FileData.h"
#include "StringUtils.h"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -156,7 +156,7 @@ void MDLImporter::InternReadFile( const std::string& pFile,
{
pScene = _pScene;
pIOHandler = _pIOHandler;
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StandardShapes.h"
#include "fast_atof.h"
#include "RemoveComments.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
@ -133,7 +133,7 @@ const aiImporterDesc* NFFImporter::GetInfo () const
void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
const std::string& path, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( path, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( path, "rb"));
// Check whether we can read from the file
if( !file.get()) {
@ -235,7 +235,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
void NFFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( !file.get())

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "OFFLoader.h"
#include "ParsingUtils.h"
#include "fast_atof.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -109,7 +109,7 @@ const aiImporterDesc* OFFImporter::GetInfo () const
void OFFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/Exporter.hpp>
#include <assimp/material.h>
#include <assimp/scene.h>
#include <boost/scoped_ptr.hpp>
#include <memory>
using namespace Assimp;
@ -66,14 +66,14 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
// we're still here - export successfully completed. Write both the main OBJ file and the material script
{
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .obj file: " + std::string(pFile));
}
outfile->Write( exporter.mOutput.str().c_str(), static_cast<size_t>(exporter.mOutput.tellp()),1);
}
{
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName()));
}

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ObjFileImporter.h"
#include "ObjFileParser.h"
#include "ObjFileData.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/ai_assert.h>
@ -117,7 +117,7 @@ const aiImporterDesc* ObjFileImporter::GetInfo () const
void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, IOSystem* pIOHandler) {
// Read file into memory
static const std::string mode = "rb";
boost::scoped_ptr<IOStream> fileStream( pIOHandler->Open( file, mode));
std::unique_ptr<IOStream> fileStream( pIOHandler->Open( file, mode));
if( !fileStream.get() ) {
throw DeadlyImportError( "Failed to open file " + file + "." );
}

View File

@ -52,7 +52,7 @@ namespace Ogre
{
typedef Assimp::StreamReaderLE MemoryStreamReader;
typedef boost::shared_ptr<MemoryStreamReader> MemoryStreamReaderPtr;
typedef std::shared_ptr<MemoryStreamReader> MemoryStreamReaderPtr;
class OgreBinarySerializer
{

View File

@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "OgreBinarySerializer.h"
#include "OgreXmlSerializer.h"
#include "../include/assimp/Importer.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
static const aiImporterDesc desc = {
"Ogre3D Mesh Importer",
@ -110,7 +110,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
MemoryStreamReader reader(f);
// Import mesh
boost::scoped_ptr<Mesh> mesh(OgreBinarySerializer::ImportMesh(&reader));
std::unique_ptr<Mesh> mesh(OgreBinarySerializer::ImportMesh(&reader));
// Import skeleton
OgreBinarySerializer::ImportSkeleton(pIOHandler, mesh.get());
@ -125,12 +125,12 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
else
{
/// @note XmlReader does not take ownership of f, hence the scoped ptr.
boost::scoped_ptr<IOStream> scopedFile(f);
boost::scoped_ptr<CIrrXML_IOStreamReader> xmlStream(new CIrrXML_IOStreamReader(scopedFile.get()));
boost::scoped_ptr<XmlReader> reader(irr::io::createIrrXMLReader(xmlStream.get()));
std::unique_ptr<IOStream> scopedFile(f);
std::unique_ptr<CIrrXML_IOStreamReader> xmlStream(new CIrrXML_IOStreamReader(scopedFile.get()));
std::unique_ptr<XmlReader> reader(irr::io::createIrrXMLReader(xmlStream.get()));
// Import mesh
boost::scoped_ptr<MeshXml> mesh(OgreXmlSerializer::ImportMesh(reader.get()));
std::unique_ptr<MeshXml> mesh(OgreXmlSerializer::ImportMesh(reader.get()));
// Import skeleton
OgreXmlSerializer::ImportSkeleton(pIOHandler, mesh.get());

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <sstream>
#include <boost/scoped_ptr.hpp>
#include <memory>
using namespace std;
@ -181,7 +181,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
return 0;
}
boost::scoped_ptr<IOStream> stream(materialFile);
std::unique_ptr<IOStream> stream(materialFile);
if (stream->FileSize() == 0)
{
DefaultLogger::get()->warn(Formatter::format() << "Source file for material '" << materialName << "' is empty (size is 0 bytes)");

View File

@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
#include "MemoryIOWrapper.h"
#include <boost/shared_ptr.hpp>
#include <memory>
#include "../include/assimp/mesh.h"
#include <map>
#include <vector>
@ -76,7 +76,7 @@ class Skeleton;
// Typedefs
typedef Assimp::MemoryIOStream MemoryStream;
typedef boost::shared_ptr<MemoryStream> MemoryStreamPtr;
typedef std::shared_ptr<MemoryStream> MemoryStreamPtr;
typedef std::map<uint16_t, MemoryStreamPtr> VertexBufferBindings;
// Ogre Vertex Element

View File

@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "TinyFormatter.h"
#include "../include/assimp/DefaultLogger.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
@ -742,12 +742,12 @@ XmlReaderPtr OgreXmlSerializer::OpenReader(Assimp::IOSystem *pIOHandler, const s
return XmlReaderPtr();
}
boost::scoped_ptr<IOStream> file(pIOHandler->Open(filename));
std::unique_ptr<IOStream> file(pIOHandler->Open(filename));
if (!file.get()) {
throw DeadlyImportError("Failed to open skeleton file " + filename);
}
boost::scoped_ptr<CIrrXML_IOStreamReader> stream(new CIrrXML_IOStreamReader(file.get()));
std::unique_ptr<CIrrXML_IOStreamReader> stream(new CIrrXML_IOStreamReader(file.get()));
XmlReaderPtr reader = XmlReaderPtr(irr::io::createIrrXMLReader(stream.get()));
if (!reader.get()) {
throw DeadlyImportError("Failed to create XML reader for skeleton file " + filename);

View File

@ -52,7 +52,7 @@ namespace Ogre
{
typedef irr::io::IrrXMLReader XmlReader;
typedef boost::shared_ptr<XmlReader> XmlReaderPtr;
typedef std::shared_ptr<XmlReader> XmlReaderPtr;
class OgreXmlSerializer
{

View File

@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if !defined(ASSIMP_BUILD_NO_EXPORT) && !defined(ASSIMP_BUILD_NO_PLY_EXPORTER)
#include "PlyExporter.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include <cmath>
#include "Exceptional.h"
#include "../include/assimp/scene.h"
@ -64,7 +64,7 @@ void ExportScenePly(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
PlyExporter exporter(pFile, pScene);
// we're still here - export successfully completed. Write the file.
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .ply file: " + std::string(pFile));
}
@ -78,7 +78,7 @@ void ExportScenePlyBinary(const char* pFile, IOSystem* pIOSystem, const aiScene*
PlyExporter exporter(pFile, pScene, true);
// we're still here - export successfully completed. Write the file.
boost::scoped_ptr<IOStream> outfile(pIOSystem->Open(pFile, "wb"));
std::unique_ptr<IOStream> outfile(pIOSystem->Open(pFile, "wb"));
if (outfile == NULL) {
throw DeadlyExportError("could not open output .ply file: " + std::string(pFile));
}

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// internal headers
#include "PlyLoader.h"
#include "Macros.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -147,7 +147,7 @@ static bool isBigEndian( const char* szMe ) {
void PLYImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "RawLoader.h"
#include "ParsingUtils.h"
#include "fast_atof.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/DefaultLogger.hpp"
#include "../include/assimp/scene.h"
@ -99,7 +99,7 @@ const aiImporterDesc* RAWImporter::GetInfo () const
void RAWImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SkeletonMeshBuilder.h"
#include "../include/assimp/Importer.hpp"
#include "../include/assimp/IOSystem.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -122,7 +122,7 @@ void SMDImporter::SetupProperties(const Importer* pImp)
// Imports the given file into the given scene structure.
void SMDImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -167,7 +167,7 @@ namespace STEP {
{
public:
typedef boost::shared_ptr<const DataType> Out;
typedef std::shared_ptr<const DataType> Out;
public:
@ -218,7 +218,7 @@ namespace STEP {
*
* @throw SyntaxError
*/
static boost::shared_ptr<const EXPRESS::DataType> Parse(const char*& inout,
static std::shared_ptr<const EXPRESS::DataType> Parse(const char*& inout,
uint64_t line = SyntaxError::LINE_NOT_SPECIFIED,
const EXPRESS::ConversionSchema* schema = NULL);
@ -338,7 +338,7 @@ namespace STEP {
public:
// access a particular list index, throw std::range_error for wrong indices
boost::shared_ptr<const DataType> operator[] (size_t index) const {
std::shared_ptr<const DataType> operator[] (size_t index) const {
return members[index];
}
@ -349,13 +349,13 @@ namespace STEP {
public:
/** @see DaraType::Parse */
static boost::shared_ptr<const EXPRESS::LIST> Parse(const char*& inout,
static std::shared_ptr<const EXPRESS::LIST> Parse(const char*& inout,
uint64_t line = SyntaxError::LINE_NOT_SPECIFIED,
const EXPRESS::ConversionSchema* schema = NULL);
private:
typedef std::vector< boost::shared_ptr<const DataType> > MemberList;
typedef std::vector< std::shared_ptr<const DataType> > MemberList;
MemberList members;
};
@ -670,12 +670,12 @@ namespace STEP {
};
template <typename T>
inline bool operator==( boost::shared_ptr<LazyObject> lo, T whatever ) {
inline bool operator==( std::shared_ptr<LazyObject> lo, T whatever ) {
return *lo == whatever; // XXX use std::forward if we have 0x
}
template <typename T>
inline bool operator==( const std::pair<uint64_t, boost::shared_ptr<LazyObject> >& lo, T whatever ) {
inline bool operator==( const std::pair<uint64_t, std::shared_ptr<LazyObject> >& lo, T whatever ) {
return *(lo.second) == whatever; // XXX use std::forward if we have 0x
}
@ -737,12 +737,12 @@ namespace STEP {
typedef EXPRESS::ENTITY Type;
};
template <> struct PickBaseType< boost::shared_ptr< const EXPRESS::DataType > >;
template <> struct PickBaseType< std::shared_ptr< const EXPRESS::DataType > >;
// ------------------------------------------------------------------------------
template <typename T>
struct InternGenericConvert {
void operator()(T& out, const boost::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) {
void operator()(T& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) {
try{
out = dynamic_cast< const typename PickBaseType<T>::Type& > ( *in );
}
@ -753,15 +753,15 @@ namespace STEP {
};
template <>
struct InternGenericConvert< boost::shared_ptr< const EXPRESS::DataType > > {
void operator()(boost::shared_ptr< const EXPRESS::DataType >& out, const boost::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) {
struct InternGenericConvert< std::shared_ptr< const EXPRESS::DataType > > {
void operator()(std::shared_ptr< const EXPRESS::DataType >& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) {
out = in;
}
};
template <typename T>
struct InternGenericConvert< Maybe<T> > {
void operator()(Maybe<T>& out, const boost::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& db) {
void operator()(Maybe<T>& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& db) {
GenericConvert((T&)out,in,db);
out.flag_valid();
}
@ -769,7 +769,7 @@ namespace STEP {
template <typename T,uint64_t min_cnt, uint64_t max_cnt>
struct InternGenericConvertList {
void operator()(ListOf<T, min_cnt, max_cnt>& out, const boost::shared_ptr< const EXPRESS::DataType >& inp_base, const STEP::DB& db) {
void operator()(ListOf<T, min_cnt, max_cnt>& out, const std::shared_ptr< const EXPRESS::DataType >& inp_base, const STEP::DB& db) {
const EXPRESS::LIST* inp = dynamic_cast<const EXPRESS::LIST*>(inp_base.get());
if (!inp) {
@ -800,7 +800,7 @@ namespace STEP {
template <typename T>
struct InternGenericConvert< Lazy<T> > {
void operator()(Lazy<T>& out, const boost::shared_ptr< const EXPRESS::DataType >& in_base, const STEP::DB& db) {
void operator()(Lazy<T>& out, const std::shared_ptr< const EXPRESS::DataType >& in_base, const STEP::DB& db) {
const EXPRESS::ENTITY* in = dynamic_cast<const EXPRESS::ENTITY*>(in_base.get());
if (!in) {
throw TypeError("type error reading entity");
@ -810,12 +810,12 @@ namespace STEP {
};
template <typename T1>
inline void GenericConvert(T1& a, const boost::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) {
inline void GenericConvert(T1& a, const std::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) {
return InternGenericConvert<T1>()(a,b,db);
}
template <typename T1,uint64_t N1, uint64_t N2>
inline void GenericConvert(ListOf<T1,N1,N2>& a, const boost::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) {
inline void GenericConvert(ListOf<T1,N1,N2>& a, const std::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) {
return InternGenericConvertList<T1,N1,N2>()(a,b,db);
}
@ -827,7 +827,7 @@ namespace STEP {
// -------------------------------------------------------------------------------
class DB
{
friend DB* ReadFileHeader(boost::shared_ptr<IOStream> stream);
friend DB* ReadFileHeader(std::shared_ptr<IOStream> stream);
friend void ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme,
const char* const* types_to_track, size_t len,
const char* const* inverse_indices_to_track, size_t len2
@ -857,7 +857,7 @@ namespace STEP {
private:
DB(boost::shared_ptr<StreamReaderLE> reader)
DB(std::shared_ptr<StreamReaderLE> reader)
: reader(reader)
, splitter(*reader,true,true)
, evaluated_count()
@ -1012,7 +1012,7 @@ namespace STEP {
RefMap refs;
InverseWhitelist inv_whitelist;
boost::shared_ptr<StreamReaderLE> reader;
std::shared_ptr<StreamReaderLE> reader;
LineSplitter splitter;
uint64_t evaluated_count;

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "fast_atof.h"
#include "../contrib/ConvertUTF/ConvertUTF.h"
#include <boost/scoped_array.hpp>
#include <memory>
using namespace Assimp;
@ -354,7 +354,7 @@ bool STEP::StringToUTF8(std::string& s)
}
const size_t count = (j-basei)/4;
boost::scoped_array<UTF16> src(new UTF16[count]);
std::unique_ptr<UTF16[]> src(new UTF16[count]);
const char* cur = s.c_str() + basei;
for (size_t k = 0; k < count; ++k, cur += 4) {
@ -363,7 +363,7 @@ bool STEP::StringToUTF8(std::string& s)
}
const size_t dcount = count * 3; // this is enough to hold all possible outputs
boost::scoped_array<UTF8> dest(new UTF8[dcount]);
std::unique_ptr<UTF8[]> dest(new UTF8[dcount]);
const UTF16* srct = src.get();
UTF8* destt = dest.get();
@ -387,7 +387,7 @@ bool STEP::StringToUTF8(std::string& s)
}
const size_t count = (j-basei)/8;
boost::scoped_array<UTF32> src(new UTF32[count]);
std::unique_ptr<UTF32[]> src(new UTF32[count]);
const char* cur = s.c_str() + basei;
for (size_t k = 0; k < count; ++k, cur += 8) {
@ -398,7 +398,7 @@ bool STEP::StringToUTF8(std::string& s)
}
const size_t dcount = count * 5; // this is enough to hold all possible outputs
boost::scoped_array<UTF8> dest(new UTF8[dcount]);
std::unique_ptr<UTF8[]> dest(new UTF8[dcount]);
const UTF32* srct = src.get();
UTF8* destt = dest.get();

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "STEPFileEncoding.h"
#include "TinyFormatter.h"
#include "fast_atof.h"
#include <boost/make_shared.hpp>
#include <memory>
using namespace Assimp;
@ -85,9 +85,9 @@ STEP::TypeError::TypeError (const std::string& s,uint64_t entity /* = ENTITY_NOT
// ------------------------------------------------------------------------------------------------
STEP::DB* STEP::ReadFileHeader(boost::shared_ptr<IOStream> stream)
STEP::DB* STEP::ReadFileHeader(std::shared_ptr<IOStream> stream)
{
boost::shared_ptr<StreamReaderLE> reader = boost::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
std::shared_ptr<StreamReaderLE> reader = std::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
std::unique_ptr<STEP::DB> db = std::unique_ptr<STEP::DB>(new STEP::DB(reader));
LineSplitter& splitter = db->GetSplitter();
@ -110,7 +110,7 @@ STEP::DB* STEP::ReadFileHeader(boost::shared_ptr<IOStream> stream)
if (s.substr(0,11) == "FILE_SCHEMA") {
const char* sz = s.c_str()+11;
SkipSpaces(sz,&sz);
boost::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz);
std::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz);
// the file schema should be a regular list entity, although it usually contains exactly one entry
// since the list itself is contained in a regular parameter list, we actually have
@ -300,7 +300,7 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme,
}
// ------------------------------------------------------------------------------------------------
boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/)
std::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/)
{
const char* cur = inout;
SkipSpaces(&cur);
@ -321,7 +321,7 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
std::transform(s.begin(),s.end(),s.begin(),&ToLower<char> );
if (schema->IsKnownToken(s)) {
for(cur = t+1;*cur++ != '(';);
const boost::shared_ptr<const EXPRESS::DataType> dt = Parse(cur);
const std::shared_ptr<const EXPRESS::DataType> dt = Parse(cur);
inout = *cur ? cur+1 : cur;
return dt;
}
@ -335,11 +335,11 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
if (*cur == '*' ) {
inout = cur+1;
return boost::make_shared<EXPRESS::ISDERIVED>();
return std::make_shared<EXPRESS::ISDERIVED>();
}
else if (*cur == '$' ) {
inout = cur+1;
return boost::make_shared<EXPRESS::UNSET>();
return std::make_shared<EXPRESS::UNSET>();
}
else if (*cur == '(' ) {
// start of an aggregate, further parsing is done by the LIST factory constructor
@ -355,11 +355,11 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
}
}
inout = cur+1;
return boost::make_shared<EXPRESS::ENUMERATION>(std::string(start, static_cast<size_t>(cur-start) ));
return std::make_shared<EXPRESS::ENUMERATION>(std::string(start, static_cast<size_t>(cur-start) ));
}
else if (*cur == '#' ) {
// object reference
return boost::make_shared<EXPRESS::ENTITY>(strtoul10_64(++cur,&inout));
return std::make_shared<EXPRESS::ENTITY>(strtoul10_64(++cur,&inout));
}
else if (*cur == '\'' ) {
// string literal
@ -393,7 +393,7 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
DefaultLogger::get()->error("an error occurred reading escape sequences in ASCII text");
}
return boost::make_shared<EXPRESS::STRING>(stemp);
return std::make_shared<EXPRESS::STRING>(stemp);
}
else if (*cur == '\"' ) {
throw STEP::SyntaxError("binary data not supported yet",line);
@ -406,7 +406,7 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
if (*cur == '.') {
double f;
inout = fast_atoreal_move<double>(start,f);
return boost::make_shared<EXPRESS::REAL>(f);
return std::make_shared<EXPRESS::REAL>(f);
}
}
@ -419,14 +419,14 @@ boost::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*&
++start;
}
int64_t num = static_cast<int64_t>( strtoul10_64(start,&inout) );
return boost::make_shared<EXPRESS::INTEGER>(neg?-num:num);
return std::make_shared<EXPRESS::INTEGER>(neg?-num:num);
}
// ------------------------------------------------------------------------------------------------
boost::shared_ptr<const EXPRESS::LIST> EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/)
std::shared_ptr<const EXPRESS::LIST> EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/)
{
const boost::shared_ptr<EXPRESS::LIST> list = boost::make_shared<EXPRESS::LIST>();
const std::shared_ptr<EXPRESS::LIST> list = std::make_shared<EXPRESS::LIST>();
EXPRESS::LIST::MemberList& members = list->members;
const char* cur = inout;
@ -522,7 +522,7 @@ void STEP::LazyObject::LazyInit() const
}
const char* acopy = args;
boost::shared_ptr<const EXPRESS::LIST> conv_args = EXPRESS::LIST::Parse(acopy,STEP::SyntaxError::LINE_NOT_SPECIFIED,&db.GetSchema());
std::shared_ptr<const EXPRESS::LIST> conv_args = EXPRESS::LIST::Parse(acopy,STEP::SyntaxError::LINE_NOT_SPECIFIED,&db.GetSchema());
delete[] args;
args = NULL;

View File

@ -50,7 +50,7 @@ namespace STEP {
// --------------------------------------------------------------------------
// 1) read file header and return to caller, who checks if the
// file is of a supported schema ..
DB* ReadFileHeader(boost::shared_ptr<IOStream> stream);
DB* ReadFileHeader(std::shared_ptr<IOStream> stream);
// --------------------------------------------------------------------------
// 2) read the actual file contents using a user-supplied set of
// conversion functions to interpret the data.

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
#include "../include/assimp/Exporter.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "Exceptional.h"
#include "ByteSwapper.h"
@ -62,7 +62,7 @@ void ExportSceneSTL(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
STLExporter exporter(pFile, pScene);
// we're still here - export successfully completed. Write the file.
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .stl file: " + std::string(pFile));
}
@ -75,7 +75,7 @@ void ExportSceneSTLBinary(const char* pFile,IOSystem* pIOSystem, const aiScene*
STLExporter exporter(pFile, pScene, true);
// we're still here - export successfully completed. Write the file.
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wb"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wb"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .stl file: " + std::string(pFile));
}

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "STLLoader.h"
#include "ParsingUtils.h"
#include "fast_atof.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
@ -172,7 +172,7 @@ void addFacesToMesh(aiMesh* pMesh)
void STLImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {

View File

@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <set>
#include <map>
#include <list>
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "Exceptional.h"
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -102,7 +102,7 @@ void ExportSceneStep(const char* pFile,IOSystem* pIOSystem, const aiScene* pScen
StepExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);
// we're still here - export successfully completed. Write result to the given IOSYstem
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .stp file: " + std::string(pFile));
}

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ByteSwapper.h"
#include "Exceptional.h"
#include <boost/shared_ptr.hpp>
#include <memory>
#include "../include/assimp/IOStream.hpp"
#include "Defines.h"
@ -90,7 +90,7 @@ public:
* stream is in little endian byte order. Otherwise the
* endianness information is contained in the @c SwapEndianess
* template parameter and this parameter is meaningless. */
StreamReader(boost::shared_ptr<IOStream> stream, bool le = false)
StreamReader(std::shared_ptr<IOStream> stream, bool le = false)
: stream(stream)
, le(le)
{
@ -100,7 +100,7 @@ public:
// ---------------------------------------------------------------------
StreamReader(IOStream* stream, bool le = false)
: stream(boost::shared_ptr<IOStream>(stream))
: stream(std::shared_ptr<IOStream>(stream))
, le(le)
{
ai_assert(stream);
@ -339,7 +339,7 @@ private:
private:
boost::shared_ptr<IOStream> stream;
std::shared_ptr<IOStream> stream;
int8_t *buffer, *current, *end, *limit;
bool le;
};

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ByteSwapper.h"
#include "../include/assimp/IOStream.hpp"
#include <boost/shared_ptr.hpp>
#include <memory>
#include <vector>
namespace Assimp {
@ -81,7 +81,7 @@ public:
* stream is in little endian byte order. Otherwise the
* endianness information is defined by the @c SwapEndianess
* template parameter and this parameter is meaningless. */
StreamWriter(boost::shared_ptr<IOStream> stream, bool le = false)
StreamWriter(std::shared_ptr<IOStream> stream, bool le = false)
: stream(stream)
, le(le)
, cursor()
@ -92,7 +92,7 @@ public:
// ---------------------------------------------------------------------
StreamWriter(IOStream* stream, bool le = false)
: stream(boost::shared_ptr<IOStream>(stream))
: stream(std::shared_ptr<IOStream>(stream))
, le(le)
, cursor()
{
@ -212,7 +212,7 @@ private:
private:
boost::shared_ptr<IOStream> stream;
std::shared_ptr<IOStream> stream;
bool le;
std::vector<uint8_t> buffer;

View File

@ -64,7 +64,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "TriangulateProcess.h"
#include "ProcessHelper.h"
#include "PolyTools.h"
#include <boost/scoped_array.hpp>
#include <memory>
//#define AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
//#define AI_BUILD_TRIANGULATE_DEBUG_POLYS
@ -191,8 +191,8 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
const aiVector3D* verts = pMesh->mVertices;
// use boost::scoped_array to avoid slow std::vector<bool> specialiations
boost::scoped_array<bool> done(new bool[max_out]);
// use std::unique_ptr to avoid slow std::vector<bool> specialiations
std::unique_ptr<bool[]> done(new bool[max_out]);
for( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
aiFace& face = pMesh->mFaces[a];

View File

@ -61,7 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp>
#include <assimp/scene.h>
#include <boost/scoped_ptr.hpp>
#include <memory>
using namespace Assimp;
@ -235,7 +235,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
nd->mName.Set("<UnrealRoot>");
// we can live without the uc file if necessary
boost::scoped_ptr<IOStream> pb (pIOHandler->Open(uc_path));
std::unique_ptr<IOStream> pb (pIOHandler->Open(uc_path));
if (pb.get()) {
std::vector<char> _data;

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BaseImporter.h"
#include "fast_atof.h"
#include "ProcessHelper.h"
#include <boost/scoped_array.hpp>
#include <memory>
// CRT headers
#include <stdarg.h>
@ -463,7 +463,7 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh)
ReportError("aiMesh::mBones is NULL (aiMesh::mNumBones is %i)",
pMesh->mNumBones);
}
boost::scoped_array<float> afSum(NULL);
std::unique_ptr<float[]> afSum(nullptr);
if (pMesh->mNumVertices)
{
afSum.reset(new float[pMesh->mNumVertices]);

View File

@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "DefaultIOSystem.h"
#include <ctime>
#include <set>
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "Exceptional.h"
#include "../include/assimp/IOSystem.hpp"
#include "../include/assimp/scene.h"
@ -81,7 +81,7 @@ void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pSce
XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);
// we're still here - export successfully completed. Write result to the given IOSYstem
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
if(outfile == NULL) {
throw DeadlyExportError("could not open output .x file: " + std::string(pFile));
}

View File

@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "XFileParser.h"
#include "ConvertToLHProcess.h"
#include "../include/assimp/IOSystem.hpp"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/scene.h"
#include "../include/assimp/DefaultLogger.hpp"
#include <boost/format.hpp>
@ -111,7 +111,7 @@ const aiImporterDesc* XFileImporter::GetInfo () const
void XFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
// read file into memory
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
if( file.get() == NULL)
throw DeadlyImportError( "Failed to open file " + pFile + ".");

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StreamReader.h"
#include "MemoryIOWrapper.h"
#include <boost/scoped_ptr.hpp>
#include <memory>
#include "../include/assimp/mesh.h"
#include "../include/assimp/scene.h"
#include <cctype>
@ -153,7 +153,7 @@ void XGLImporter::InternReadFile( const std::string& pFile,
#endif
scene = pScene;
boost::shared_ptr<IOStream> stream( pIOHandler->Open( pFile, "rb"));
std::shared_ptr<IOStream> stream( pIOHandler->Open( pFile, "rb"));
// check whether we can read from the file
if( stream.get() == NULL) {
@ -165,7 +165,7 @@ void XGLImporter::InternReadFile( const std::string& pFile,
#ifdef ASSIMP_BUILD_NO_COMPRESSED_XGL
ThrowException("Cannot read ZGL file since Assimp was built without compression support");
#else
boost::scoped_ptr<StreamReaderLE> raw_reader(new StreamReaderLE(stream));
std::unique_ptr<StreamReaderLE> raw_reader(new StreamReaderLE(stream));
// build a zlib stream
z_stream zstream;
@ -214,7 +214,7 @@ void XGLImporter::InternReadFile( const std::string& pFile,
// construct the irrXML parser
CIrrXML_IOStreamReader st(stream.get());
boost::scoped_ptr<IrrXMLReader> read( createIrrXMLReader((IFileReadCallBack*) &st) );
std::unique_ptr<IrrXMLReader> read( createIrrXMLReader((IFileReadCallBack*) &st) );
reader = read.get();
// parse the XML file

View File

@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rapidjson/error/en.h>
#ifdef ASSIMP_API
# include "boost/shared_ptr.hpp"
# include <memory>
# include "DefaultIOSystem.h"
# include "ByteSwapper.h"
#else
@ -90,7 +90,7 @@ namespace glTF
#ifdef ASSIMP_API
using Assimp::IOStream;
using Assimp::IOSystem;
using boost::shared_ptr;
using std::shared_ptr;
#else
using std::shared_ptr;

View File

@ -330,7 +330,7 @@ namespace glTF {
{
bool isBinary = mAsset.extensionsUsed.KHR_binary_glTF;
boost::scoped_ptr<IOStream> outfile
std::unique_ptr<IOStream> outfile
(mAsset.OpenFile(path, isBinary ? "wb" : "wt", true));
if (outfile == 0) {

View File

@ -54,8 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/material.h>
#include <assimp/scene.h>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <memory>
#include "glTFAssetWriter.h"
@ -93,7 +93,7 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc
, mScene(pScene)
, mProperties(pProperties)
{
boost::scoped_ptr<Asset> asset(new glTF::Asset(pIOSystem));
std::unique_ptr<Asset> asset(new glTF::Asset(pIOSystem));
mAsset = asset.get();
if (isBinary) {

View File

@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <map>
#include "boost/scoped_ptr.hpp"
#include <memory>
struct aiScene;

View File

@ -44,13 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StringComparison.h"
#include "boost/scoped_ptr.hpp"
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/ai_assert.h>
#include <assimp/DefaultLogger.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#include "glTFAsset.h"
@ -103,7 +101,7 @@ bool glTFImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool
if ((checkSig || !extension.length()) && pIOHandler) {
char buffer[4];
boost::scoped_ptr<IOStream> pStream(pIOHandler->Open(pFile));
std::unique_ptr<IOStream> pStream(pIOHandler->Open(pFile));
if (pStream && pStream->Read(buffer, sizeof(buffer), 1) == 1) {
if (memcmp(buffer, AI_GLB_MAGIC_NUMBER, sizeof(buffer)) == 0) {
return true; // Has GLB header

View File

@ -56,13 +56,13 @@ namespace Assimp {
* Construct IrrXML-Reader in BaseImporter::InternReadFile():
* @code
* // open the file
* boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
* std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
* if( file.get() == NULL) {
* throw DeadlyImportError( "Failed to open file " + pFile + ".");
* }
*
* // generate a XML reader for it
* boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
* std::unique_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
* mReader = irr::io::createIrrXMLReader( mIOWrapper.get());
* if( !mReader) {
* ThrowException( "xxxx: Unable to open file.");

View File

@ -1680,7 +1680,7 @@ void xxxxImporter::GetExtensionList(std::set<std::string>& extensions)
void xxxxImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL) {