diff --git a/code/3DSConverter.cpp b/code/3DSConverter.cpp index cea255380..419b71b29 100644 --- a/code/3DSConverter.cpp +++ b/code/3DSConverter.cpp @@ -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 +#include #include using namespace Assimp; @@ -359,7 +359,7 @@ void Discreet3DSImporter::ConvertMeshes(aiScene* pcOut) // we need to split all meshes by their materials for (std::vector::iterator i = mScene->mMeshes.begin(); i != mScene->mMeshes.end();++i) { - boost::scoped_array< std::vector > aiSplit(new std::vector[mScene->mMaterials.size()]); + std::unique_ptr< std::vector[] > aiSplit(new std::vector[mScene->mMaterials.size()]); name.length = ASSIMP_itoa10(name.data,num++); diff --git a/code/3DSExporter.cpp b/code/3DSExporter.cpp index 16e1e8a01..5450c1baf 100644 --- a/code/3DSExporter.cpp +++ b/code/3DSExporter.cpp @@ -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 outfile (pIOSystem->Open(pFile, "wb")); + std::shared_ptr 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 outfile, const aiScene* scene) +Discreet3DSExporter:: Discreet3DSExporter(std::shared_ptr outfile, const aiScene* scene) : scene(scene) , writer(outfile) { diff --git a/code/3DSExporter.h b/code/3DSExporter.h index ce9a02f78..321539cff 100644 --- a/code/3DSExporter.h +++ b/code/3DSExporter.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_3DSEXPORTER_H_INC #include -#include +#include #include "StreamWriter.h" #include "./../include/assimp/material.h" @@ -64,7 +64,7 @@ namespace Assimp class Discreet3DSExporter { public: - Discreet3DSExporter(boost::shared_ptr outfile, const aiScene* pScene); + Discreet3DSExporter(std::shared_ptr outfile, const aiScene* pScene); private: diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index 4607d3536..fbe8cb009 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -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 +#include 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 div(Subdivider::Create(Subdivider::CATMULL_CLARKE)); + std::unique_ptr div(Subdivider::Create(Subdivider::CATMULL_CLARKE)); DefaultLogger::get()->info("AC3D: Evaluating subdivision surface: "+object.name); std::vector 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 file( pIOHandler->Open( pFile, "rb")); + std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file if( file.get() == NULL) diff --git a/code/ASELoader.cpp b/code/ASELoader.cpp index 514b6b66c..6f6610786 100644 --- a/code/ASELoader.cpp +++ b/code/ASELoader.cpp @@ -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 +#include #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 file( pIOHandler->Open( pFile, "rb")); + std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file if( file.get() == NULL) { diff --git a/code/B3DImporter.cpp b/code/B3DImporter.cpp index 05109cacb..a8214814d 100644 --- a/code/B3DImporter.cpp +++ b/code/B3DImporter.cpp @@ -7,8 +7,8 @@ Copyright (c) 2006-2016, assimp team All rights reserved. -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above @@ -25,16 +25,16 @@ conditions are met: derived from this software without specific prior written permission of the assimp team. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ @@ -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 +#include #include "../include/assimp/IOSystem.hpp" #include "../include/assimp/anim.h" #include "../include/assimp/scene.h" @@ -71,11 +71,11 @@ static const aiImporterDesc desc = { 0, 0, 0, - "b3d" + "b3d" }; // (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings -#ifdef _MSC_VER +#ifdef _MSC_VER # pragma warning (disable: 4018) #endif @@ -114,7 +114,7 @@ void B3DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS cout<<"Hello world from the B3DImporter!"< file( pIOHandler->Open( pFile)); + std::unique_ptr file( pIOHandler->Open( pFile)); // Check whether we can read from the file if( file.get() == NULL) @@ -280,12 +280,12 @@ void B3DImporter::ReadBRUS(){ aiMaterial *mat=new aiMaterial; _materials.push_back( mat ); - + // Name aiString ainame( name ); mat->AddProperty( &ainame,AI_MATKEY_NAME ); - - // Diffuse color + + // Diffuse color mat->AddProperty( &color,1,AI_MATKEY_COLOR_DIFFUSE ); // Opacity @@ -294,16 +294,16 @@ void B3DImporter::ReadBRUS(){ // Specular color aiColor3D speccolor( shiny,shiny,shiny ); mat->AddProperty( &speccolor,1,AI_MATKEY_COLOR_SPECULAR ); - + // Specular power float specpow=shiny*128; mat->AddProperty( &specpow,1,AI_MATKEY_SHININESS ); - + // Double sided if( fx & 0x10 ){ - int i=1; + int i=1; mat->AddProperty( &i,1,AI_MATKEY_TWOSIDED ); - } + } //Textures for( int i=0;imNumMaterials=_materials.size(); scene->mMaterials=to_array( _materials ); - + //meshes scene->mNumMeshes=_meshes.size(); scene->mMeshes=to_array( _meshes ); diff --git a/code/BVHLoader.cpp b/code/BVHLoader.cpp index 682ad2a9d..670379f00 100644 --- a/code/BVHLoader.cpp +++ b/code/BVHLoader.cpp @@ -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 +#include #include #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 file( pIOHandler->Open( pFile)); + std::unique_ptr file( pIOHandler->Open( pFile)); if( file.get() == NULL) throw DeadlyImportError( "Failed to open file " + pFile + "."); diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index daed1c4ca..a7e134c54 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -52,8 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../include/assimp/postprocess.h" #include #include -#include -#include +#include #include #include @@ -149,10 +148,10 @@ void BaseImporter::GetExtensionList(std::set& extensions) if (!pIOHandler) return false; - boost::scoped_ptr pStream (pIOHandler->Open(pFile)); + std::unique_ptr pStream (pIOHandler->Open(pFile)); if (pStream.get() ) { // read 200 characters from the file - boost::scoped_array _buffer (new char[searchBytes+1 /* for the '\0' */]); + std::unique_ptr _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& extensions) const uint32_t* magic_u32; }; magic = reinterpret_cast(_magic); - boost::scoped_ptr pStream (pIOHandler->Open(pFile)); + std::unique_ptr pStream (pIOHandler->Open(pFile)); if (pStream.get() ) { // skip to offset diff --git a/code/BlenderDNA.cpp b/code/BlenderDNA.cpp index a91c9f33d..4a0cb7753 100644 --- a/code/BlenderDNA.cpp +++ b/code/BlenderDNA.cpp @@ -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::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; diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 98095391b..c5d85e43c 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -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 -#include +#include // 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 + * data type is not static, i.e. a std::shared_ptr * 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 - void Convert(boost::shared_ptr in,const FileDatabase& db) const; + void Convert(std::shared_ptr in,const FileDatabase& db) const; // -------------------------------------------------------- // generic allocator - template boost::shared_ptr Allocate() const; + template std::shared_ptr 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 class TOUT, typename T> bool ReadFieldPtr(TOUT& 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 class TOUT, typename T, size_t N> bool ReadFieldPtr(TOUT (&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 T* _allocate(boost::shared_ptr& out, size_t& s) const { - out = boost::shared_ptr(new T()); + template T* _allocate(std::shared_ptr& out, size_t& s) const { + out = std::shared_ptr(new T()); s = 1; return out.get(); } @@ -394,7 +394,7 @@ template <> struct Structure :: _defaultInitializer { }; // ------------------------------------------------------------------------------------------------------- -template <> inline bool Structure :: ResolvePointer(boost::shared_ptr& out, +template <> inline bool Structure :: ResolvePointer(std::shared_ptr& out, const Pointer & ptrval, const FileDatabase& db, const Field& f, @@ -413,11 +413,11 @@ class DNA public: typedef void (Structure::*ConvertProcPtr) ( - boost::shared_ptr in, + std::shared_ptr in, const FileDatabase& ) const; - typedef boost::shared_ptr ( + typedef std::shared_ptr ( 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 - ObjectCache& cache(boost::shared_ptr& /*in*/) const { + ObjectCache& cache(std::shared_ptr& /*in*/) const { return _cache; } @@ -755,7 +755,7 @@ private: #endif mutable ObjectCache _cacheArrays; - mutable ObjectCache _cache; + mutable ObjectCache _cache; mutable size_t next_cache_idx; }; diff --git a/code/BlenderDNA.inl b/code/BlenderDNA.inl index f23d723ee..0b3f2fd02 100644 --- a/code/BlenderDNA.inl +++ b/code/BlenderDNA.inl @@ -5,8 +5,8 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2016, assimp team All rights reserved. -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above @@ -23,29 +23,29 @@ following conditions are met: derived from this software without specific prior written permission of the assimp team. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ /** @file BlenderDNA.inl - * @brief Blender `DNA` (file format specification embedded in + * @brief Blender `DNA` (file format specification embedded in * blend file itself) loader. */ #ifndef INCLUDED_AI_BLEND_DNA_INL #define INCLUDED_AI_BLEND_DNA_INL -#include +#include namespace Assimp { namespace Blender { @@ -71,7 +71,7 @@ const Field* Structure :: Get (const std::string& ss) const } //-------------------------------------------------------------------------------- -const Field& Structure :: operator [] (const size_t i) const +const Field& Structure :: operator [] (const size_t i) const { if (i >= fields.size()) { throw Error((Formatter::format(), @@ -83,15 +83,15 @@ const Field& Structure :: operator [] (const size_t i) const } //-------------------------------------------------------------------------------- -template boost::shared_ptr Structure :: Allocate() const +template std::shared_ptr Structure :: Allocate() const { - return boost::shared_ptr(new T()); + return std::shared_ptr(new T()); } //-------------------------------------------------------------------------------- template void Structure :: Convert( - boost::shared_ptr in, - const FileDatabase& db) const + std::shared_ptr in, + const FileDatabase& db) const { Convert (*static_cast ( in.get() ),db); } @@ -226,7 +226,7 @@ bool Structure :: ReadFieldPtr(TOUT& out, const char* name, const FileDatabas //-------------------------------------------------------------------------------- template class TOUT, typename T, size_t N> -bool Structure :: ReadFieldPtr(TOUT (&out)[N], const char* name, +bool Structure :: ReadFieldPtr(TOUT (&out)[N], const char* name, const FileDatabase& db) const { // XXX see if we can reduce this to call to the 'normal' ReadFieldPtr @@ -306,12 +306,12 @@ void Structure :: ReadField(T& out, const char* name, const FileDatabase& db) co //-------------------------------------------------------------------------------- template