replaced boost smart pointers with c++11 smart pointers
parent
cff5b0d1a0
commit
5dacda0a08
|
@ -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++);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
#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!"<<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)
|
||||
|
@ -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;i<n_texs;++i ){
|
||||
|
@ -569,7 +569,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
|
|||
string t=ReadChunk();
|
||||
if( t=="BB3D" ){
|
||||
int version=ReadInt();
|
||||
|
||||
|
||||
if (!DefaultLogger::isNullLogger()) {
|
||||
char dmp[128];
|
||||
ai_snprintf(dmp, 128, "B3D file format version: %i",version);
|
||||
|
@ -669,7 +669,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
|
|||
}
|
||||
scene->mNumMaterials=_materials.size();
|
||||
scene->mMaterials=to_array( _materials );
|
||||
|
||||
|
||||
//meshes
|
||||
scene->mNumMeshes=_meshes.size();
|
||||
scene->mMeshes=to_array( _meshes );
|
||||
|
|
|
@ -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 + ".");
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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 <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
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 <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,
|
||||
const FileDatabase& db) const
|
||||
std::shared_ptr<ElemBase> in,
|
||||
const FileDatabase& db) const
|
||||
{
|
||||
Convert<T> (*static_cast<T*> ( in.get() ),db);
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ bool Structure :: ReadFieldPtr(TOUT<T>& out, const char* name, const FileDatabas
|
|||
|
||||
//--------------------------------------------------------------------------------
|
||||
template <int error_policy, template <typename> class TOUT, typename T, size_t N>
|
||||
bool Structure :: ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
|
||||
bool Structure :: ReadFieldPtr(TOUT<T> (&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 <template <typename> class TOUT, typename T>
|
||||
bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const FileDatabase& db,
|
||||
const Field& f,
|
||||
bool non_recursive /*= false*/) const
|
||||
bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const FileDatabase& db,
|
||||
const Field& f,
|
||||
bool non_recursive /*= false*/) const
|
||||
{
|
||||
out.reset(); // ensure null pointers work
|
||||
if (!ptrval.val) {
|
||||
if (!ptrval.val) {
|
||||
return false;
|
||||
}
|
||||
const Structure& s = db.dna[f.type];
|
||||
|
@ -328,7 +328,7 @@ bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const Fil
|
|||
}
|
||||
|
||||
// try to retrieve the object from the cache
|
||||
db.cache(out).get(s,out,ptrval);
|
||||
db.cache(out).get(s,out,ptrval);
|
||||
if (out) {
|
||||
return true;
|
||||
}
|
||||
|
@ -340,11 +340,11 @@ bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const Fil
|
|||
// I really ought to improve StreamReader to work with 64 bit indices exclusively.
|
||||
|
||||
// continue conversion after allocating the required storage
|
||||
size_t num = block->size / ss.size;
|
||||
size_t num = block->size / ss.size;
|
||||
T* o = _allocate(out,num);
|
||||
|
||||
// cache the object before we convert it to avoid cyclic recursion.
|
||||
db.cache(out).set(s,out,ptrval);
|
||||
db.cache(out).set(s,out,ptrval);
|
||||
|
||||
// if the non_recursive flag is set, we don't do anything but leave
|
||||
// the cursor at the correct position to resolve the object.
|
||||
|
@ -366,45 +366,45 @@ bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const Fil
|
|||
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
inline bool Structure :: ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
inline bool Structure :: ResolvePointer( std::shared_ptr< FileOffset >& out, const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
const Field&,
|
||||
bool) const
|
||||
{
|
||||
// Currently used exclusively by PackedFile::data to represent
|
||||
// a simple offset into the mapped BLEND file.
|
||||
// a simple offset into the mapped BLEND file.
|
||||
out.reset();
|
||||
if (!ptrval.val) {
|
||||
if (!ptrval.val) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
template <template <typename> class TOUT, typename T>
|
||||
bool Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
bool Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
const Field& f,
|
||||
bool) const
|
||||
bool) const
|
||||
{
|
||||
// This is a function overload, not a template specialization. According to
|
||||
// the partial ordering rules, it should be selected by the compiler
|
||||
// for array-of-pointer inputs, i.e. Object::mats.
|
||||
|
||||
out.reset();
|
||||
if (!ptrval.val) {
|
||||
if (!ptrval.val) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// find the file block the pointer is pointing to
|
||||
const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
|
||||
const size_t num = block->size / (db.i64bit?8:4);
|
||||
const size_t num = block->size / (db.i64bit?8:4);
|
||||
|
||||
// keep the old stream position
|
||||
const StreamReaderAny::pos pold = db.reader->GetCurrentPos();
|
||||
|
@ -418,7 +418,7 @@ bool Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
|
|||
Convert(val,db);
|
||||
|
||||
// and resolve the pointees
|
||||
res = ResolvePointer(out[i],val,db,f) && res;
|
||||
res = ResolvePointer(out[i],val,db,f) && res;
|
||||
}
|
||||
|
||||
db.reader->SetCurrentPos(pold);
|
||||
|
@ -426,18 +426,18 @@ bool Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
template <> bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
|
||||
const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
template <> bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(std::shared_ptr<ElemBase>& out,
|
||||
const Pointer & ptrval,
|
||||
const FileDatabase& db,
|
||||
const Field&,
|
||||
bool
|
||||
) const
|
||||
) const
|
||||
{
|
||||
// Special case when the data type needs to be determined at runtime.
|
||||
// Less secure than in the `strongly-typed` case.
|
||||
|
||||
out.reset();
|
||||
if (!ptrval.val) {
|
||||
if (!ptrval.val) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ template <> bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::
|
|||
const Structure& s = db.dna[block->dna_index];
|
||||
|
||||
// try to retrieve the object from the cache
|
||||
db.cache(out).get(s,out,ptrval);
|
||||
db.cache(out).get(s,out,ptrval);
|
||||
if (out) {
|
||||
return true;
|
||||
}
|
||||
|
@ -473,15 +473,15 @@ template <> bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::
|
|||
|
||||
// allocate the object hull
|
||||
out = (s.*builders.first)();
|
||||
|
||||
// cache the object immediately to prevent infinite recursion in a
|
||||
|
||||
// cache the object immediately to prevent infinite recursion in a
|
||||
// circular list with a single element (i.e. a self-referencing element).
|
||||
db.cache(out).set(s,out,ptrval);
|
||||
|
||||
// and do the actual conversion
|
||||
(s.*builders.second)(out,db);
|
||||
db.reader->SetCurrentPos(pold);
|
||||
|
||||
|
||||
// store a pointer to the name string of the actual type
|
||||
// in the object itself. This allows the conversion code
|
||||
// to perform additional type checking.
|
||||
|
@ -495,10 +495,10 @@ template <> bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
const FileBlockHead* Structure :: LocateFileBlockForAddress(const Pointer & ptrval, const FileDatabase& db) const
|
||||
const FileBlockHead* Structure :: LocateFileBlockForAddress(const Pointer & ptrval, const FileDatabase& db) const
|
||||
{
|
||||
// the file blocks appear in list sorted by
|
||||
// with ascending base addresses so we can run a
|
||||
// with ascending base addresses so we can run a
|
||||
// binary search to locate the pointee quickly.
|
||||
|
||||
// NOTE: Blender seems to distinguish between side-by-side
|
||||
|
@ -525,7 +525,7 @@ const FileBlockHead* Structure :: LocateFileBlockForAddress(const Pointer & ptrv
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// NOTE: The MSVC debugger keeps showing up this annoying `a cast to a smaller data type has
|
||||
// NOTE: The MSVC debugger keeps showing up this annoying `a cast to a smaller data type has
|
||||
// caused a loss of data`-warning. Avoid this warning by a masking with an appropriate bitmask.
|
||||
|
||||
template <typename T> struct signless;
|
||||
|
@ -534,7 +534,7 @@ template <> struct signless<short> {typedef unsigned short type;};
|
|||
template <> struct signless<int> {typedef unsigned int type;};
|
||||
|
||||
template <typename T>
|
||||
struct static_cast_silent {
|
||||
struct static_cast_silent {
|
||||
template <typename V>
|
||||
T operator()(V in) {
|
||||
return static_cast<T>(in & static_cast<typename signless<T>::type>(-1));
|
||||
|
@ -554,7 +554,7 @@ template <> struct static_cast_silent<double> {
|
|||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename T> inline void ConvertDispatcher(T& out, const Structure& in,const FileDatabase& db)
|
||||
template <typename T> inline void ConvertDispatcher(T& out, const Structure& in,const FileDatabase& db)
|
||||
{
|
||||
if (in.name == "int") {
|
||||
out = static_cast_silent<T>()(db.reader->GetU4());
|
||||
|
@ -677,7 +677,7 @@ const Structure* DNA :: Get (const std::string& ss) const
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
const Structure& DNA :: operator [] (const size_t i) const
|
||||
const Structure& DNA :: operator [] (const size_t i) const
|
||||
{
|
||||
if (i >= structures.size()) {
|
||||
throw Error((Formatter::format(),
|
||||
|
@ -690,8 +690,8 @@ const Structure& DNA :: operator [] (const size_t i) const
|
|||
|
||||
//--------------------------------------------------------------------------------
|
||||
template <template <typename> class TOUT> template <typename T> void ObjectCache<TOUT> :: get (
|
||||
const Structure& s,
|
||||
TOUT<T>& out,
|
||||
const Structure& s,
|
||||
TOUT<T>& out,
|
||||
const Pointer& ptr
|
||||
) const {
|
||||
|
||||
|
@ -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;
|
||||
|
@ -715,7 +715,7 @@ template <template <typename> class TOUT> template <typename T> void ObjectCache
|
|||
|
||||
//--------------------------------------------------------------------------------
|
||||
template <template <typename> class TOUT> template <typename T> void ObjectCache<TOUT> :: set (
|
||||
const Structure& s,
|
||||
const Structure& s,
|
||||
const TOUT<T>& out,
|
||||
const Pointer& ptr
|
||||
) {
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
||||
// --------------------
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace boost {
|
||||
|
||||
// small replacement for boost::scoped_ptr
|
||||
// small replacement for std::unique_ptr
|
||||
template <class T>
|
||||
class scoped_ptr
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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])?(
|
||||
|
|
|
@ -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;
|
||||
|
||||
// ------------------
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
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
|
||||
following conditions are met:
|
||||
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
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
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
|
@ -34,7 +34,7 @@
|
|||
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.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -49,11 +49,11 @@
|
|||
#include "ColladaHelper.h"
|
||||
#include "../include/assimp/ai_assert.h"
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Assimp
|
||||
{
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
/** Parser helper class for the Collada loader.
|
||||
*
|
||||
|
@ -63,23 +63,23 @@ namespace Assimp
|
|||
class ColladaParser
|
||||
{
|
||||
friend class ColladaLoader;
|
||||
|
||||
|
||||
protected:
|
||||
/** Constructor from XML file */
|
||||
ColladaParser( IOSystem* pIOHandler, const std::string& pFile);
|
||||
|
||||
|
||||
/** Destructor */
|
||||
~ColladaParser();
|
||||
|
||||
|
||||
/** Reads the contents of the file */
|
||||
void ReadContents();
|
||||
|
||||
|
||||
/** Reads the structure of the file */
|
||||
void ReadStructure();
|
||||
|
||||
|
||||
/** Reads asset informations such as coordinate system informations and legal blah */
|
||||
void ReadAssetInfo();
|
||||
|
||||
|
||||
/** Reads the animation library */
|
||||
void ReadAnimationLibrary();
|
||||
|
||||
|
@ -88,137 +88,137 @@ namespace Assimp
|
|||
|
||||
/** Re-build animations from animation clip library, if present, otherwise combine single-channel animations */
|
||||
void PostProcessRootAnimations();
|
||||
|
||||
|
||||
/** Reads an animation into the given parent structure */
|
||||
void ReadAnimation( Collada::Animation* pParent);
|
||||
|
||||
|
||||
/** Reads an animation sampler into the given anim channel */
|
||||
void ReadAnimationSampler( Collada::AnimationChannel& pChannel);
|
||||
|
||||
|
||||
/** Reads the skeleton controller library */
|
||||
void ReadControllerLibrary();
|
||||
|
||||
|
||||
/** Reads a controller into the given mesh structure */
|
||||
void ReadController( Collada::Controller& pController);
|
||||
|
||||
|
||||
/** Reads the joint definitions for the given controller */
|
||||
void ReadControllerJoints( Collada::Controller& pController);
|
||||
|
||||
|
||||
/** Reads the joint weights for the given controller */
|
||||
void ReadControllerWeights( Collada::Controller& pController);
|
||||
|
||||
|
||||
/** Reads the image library contents */
|
||||
void ReadImageLibrary();
|
||||
|
||||
|
||||
/** Reads an image entry into the given image */
|
||||
void ReadImage( Collada::Image& pImage);
|
||||
|
||||
|
||||
/** Reads the material library */
|
||||
void ReadMaterialLibrary();
|
||||
|
||||
|
||||
/** Reads a material entry into the given material */
|
||||
void ReadMaterial( Collada::Material& pMaterial);
|
||||
|
||||
|
||||
/** Reads the camera library */
|
||||
void ReadCameraLibrary();
|
||||
|
||||
|
||||
/** Reads a camera entry into the given camera */
|
||||
void ReadCamera( Collada::Camera& pCamera);
|
||||
|
||||
|
||||
/** Reads the light library */
|
||||
void ReadLightLibrary();
|
||||
|
||||
|
||||
/** Reads a light entry into the given light */
|
||||
void ReadLight( Collada::Light& pLight);
|
||||
|
||||
|
||||
/** Reads the effect library */
|
||||
void ReadEffectLibrary();
|
||||
|
||||
|
||||
/** Reads an effect entry into the given effect*/
|
||||
void ReadEffect( Collada::Effect& pEffect);
|
||||
|
||||
|
||||
/** Reads an COMMON effect profile */
|
||||
void ReadEffectProfileCommon( Collada::Effect& pEffect);
|
||||
|
||||
|
||||
/** Read sampler properties */
|
||||
void ReadSamplerProperties( Collada::Sampler& pSampler);
|
||||
|
||||
|
||||
/** Reads an effect entry containing a color or a texture defining that color */
|
||||
void ReadEffectColor( aiColor4D& pColor, Collada::Sampler& pSampler);
|
||||
|
||||
|
||||
/** Reads an effect entry containing a float */
|
||||
void ReadEffectFloat( float& pFloat);
|
||||
|
||||
|
||||
/** Reads an effect parameter specification of any kind */
|
||||
void ReadEffectParam( Collada::EffectParam& pParam);
|
||||
|
||||
|
||||
/** Reads the geometry library contents */
|
||||
void ReadGeometryLibrary();
|
||||
|
||||
|
||||
/** Reads a geometry from the geometry library. */
|
||||
void ReadGeometry( Collada::Mesh* pMesh);
|
||||
|
||||
|
||||
/** Reads a mesh from the geometry library */
|
||||
void ReadMesh( Collada::Mesh* pMesh);
|
||||
|
||||
|
||||
/** Reads a source element - a combination of raw data and an accessor defining
|
||||
* things that should not be redefinable. Yes, that's another rant.
|
||||
*/
|
||||
void ReadSource();
|
||||
|
||||
|
||||
/** Reads a data array holding a number of elements, and stores it in the global library.
|
||||
* Currently supported are array of floats and arrays of strings.
|
||||
*/
|
||||
void ReadDataArray();
|
||||
|
||||
|
||||
/** Reads an accessor and stores it in the global library under the given ID -
|
||||
* accessors use the ID of the parent <source> element
|
||||
*/
|
||||
void ReadAccessor( const std::string& pID);
|
||||
|
||||
|
||||
/** Reads input declarations of per-vertex mesh data into the given mesh */
|
||||
void ReadVertexData( Collada::Mesh* pMesh);
|
||||
|
||||
|
||||
/** Reads input declarations of per-index mesh data into the given mesh */
|
||||
void ReadIndexData( Collada::Mesh* pMesh);
|
||||
|
||||
|
||||
/** Reads a single input channel element and stores it in the given array, if valid */
|
||||
void ReadInputChannel( std::vector<Collada::InputChannel>& poChannels);
|
||||
|
||||
|
||||
/** Reads a <p> primitive index list and assembles the mesh data into the given mesh */
|
||||
size_t ReadPrimitives( Collada::Mesh* pMesh, std::vector<Collada::InputChannel>& pPerIndexChannels,
|
||||
size_t pNumPrimitives, const std::vector<size_t>& pVCount, Collada::PrimitiveType pPrimType);
|
||||
|
||||
|
||||
/** Copies the data for a single primitive into the mesh, based on the InputChannels */
|
||||
void CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset,
|
||||
Collada::Mesh* pMesh, std::vector<Collada::InputChannel>& pPerIndexChannels,
|
||||
size_t currentPrimitive, const std::vector<size_t>& indices);
|
||||
|
||||
|
||||
/** Reads one triangle of a tristrip into the mesh */
|
||||
void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh* pMesh,
|
||||
std::vector<Collada::InputChannel>& pPerIndexChannels, size_t currentPrimitive, const std::vector<size_t>& indices);
|
||||
|
||||
|
||||
/** Extracts a single object from an input channel and stores it in the appropriate mesh data array */
|
||||
void ExtractDataObjectFromChannel( const Collada::InputChannel& pInput, size_t pLocalIndex, Collada::Mesh* pMesh);
|
||||
|
||||
|
||||
/** Reads the library of node hierarchies and scene parts */
|
||||
void ReadSceneLibrary();
|
||||
|
||||
|
||||
/** Reads a scene node's contents including children and stores it in the given node */
|
||||
void ReadSceneNode( Collada::Node* pNode);
|
||||
|
||||
|
||||
/** Reads a node transformation entry of the given type and adds it to the given node's transformation list. */
|
||||
void ReadNodeTransformation( Collada::Node* pNode, Collada::TransformType pType);
|
||||
|
||||
|
||||
/** Reads a mesh reference in a node and adds it to the node's mesh list */
|
||||
void ReadNodeGeometry( Collada::Node* pNode);
|
||||
|
||||
|
||||
/** Reads the collada scene */
|
||||
void ReadScene();
|
||||
|
||||
|
||||
// Processes bind_vertex_input and bind elements
|
||||
void ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl);
|
||||
|
||||
|
||||
protected:
|
||||
/** Aborts the file reading with an exception */
|
||||
AI_WONT_RETURN void ThrowException( const std::string& pError) const AI_WONT_RETURN_SUFFIX;
|
||||
|
@ -226,95 +226,95 @@ namespace Assimp
|
|||
|
||||
/** Skips all data until the end node of the current element */
|
||||
void SkipElement();
|
||||
|
||||
|
||||
/** Skips all data until the end node of the given element */
|
||||
void SkipElement( const char* pElement);
|
||||
|
||||
|
||||
/** Compares the current xml element name to the given string and returns true if equal */
|
||||
bool IsElement( const char* pName) const;
|
||||
|
||||
|
||||
/** Tests for the opening tag of the given element, throws an exception if not found */
|
||||
void TestOpening( const char* pName);
|
||||
|
||||
|
||||
/** Tests for the closing tag of the given element, throws an exception if not found */
|
||||
void TestClosing( const char* pName);
|
||||
|
||||
|
||||
/** Checks the present element for the presence of the attribute, returns its index
|
||||
or throws an exception if not found */
|
||||
int GetAttribute( const char* pAttr) const;
|
||||
|
||||
|
||||
/** Returns the index of the named attribute or -1 if not found. Does not throw,
|
||||
therefore useful for optional attributes */
|
||||
int TestAttribute( const char* pAttr) const;
|
||||
|
||||
|
||||
/** Reads the text contents of an element, throws an exception if not given.
|
||||
Skips leading whitespace. */
|
||||
const char* GetTextContent();
|
||||
|
||||
|
||||
/** Reads the text contents of an element, returns NULL if not given.
|
||||
Skips leading whitespace. */
|
||||
const char* TestTextContent();
|
||||
|
||||
|
||||
/** Reads a single bool from current text content */
|
||||
bool ReadBoolFromTextContent();
|
||||
|
||||
|
||||
/** Reads a single float from current text content */
|
||||
float ReadFloatFromTextContent();
|
||||
|
||||
|
||||
/** Calculates the resulting transformation from all the given transform steps */
|
||||
aiMatrix4x4 CalculateResultTransform( const std::vector<Collada::Transform>& pTransforms) const;
|
||||
|
||||
|
||||
/** Determines the input data type for the given semantic string */
|
||||
Collada::InputType GetTypeForSemantic( const std::string& pSemantic);
|
||||
|
||||
|
||||
/** Finds the item in the given library by its reference, throws if not found */
|
||||
template <typename Type> const Type& ResolveLibraryReference(
|
||||
const std::map<std::string, Type>& pLibrary, const std::string& pURL) const;
|
||||
|
||||
|
||||
protected:
|
||||
/** Filename, for a verbose error message */
|
||||
std::string mFileName;
|
||||
|
||||
|
||||
/** XML reader, member for everyday use */
|
||||
irr::io::IrrXMLReader* mReader;
|
||||
|
||||
|
||||
/** All data arrays found in the file by ID. Might be referred to by actually
|
||||
everyone. Collada, you are a steaming pile of indirection. */
|
||||
typedef std::map<std::string, Collada::Data> DataLibrary;
|
||||
DataLibrary mDataLibrary;
|
||||
|
||||
|
||||
/** Same for accessors which define how the data in a data array is accessed. */
|
||||
typedef std::map<std::string, Collada::Accessor> AccessorLibrary;
|
||||
AccessorLibrary mAccessorLibrary;
|
||||
|
||||
|
||||
/** Mesh library: mesh by ID */
|
||||
typedef std::map<std::string, Collada::Mesh*> MeshLibrary;
|
||||
MeshLibrary mMeshLibrary;
|
||||
|
||||
|
||||
/** node library: root node of the hierarchy part by ID */
|
||||
typedef std::map<std::string, Collada::Node*> NodeLibrary;
|
||||
NodeLibrary mNodeLibrary;
|
||||
|
||||
|
||||
/** Image library: stores texture properties by ID */
|
||||
typedef std::map<std::string, Collada::Image> ImageLibrary;
|
||||
ImageLibrary mImageLibrary;
|
||||
|
||||
|
||||
/** Effect library: surface attributes by ID */
|
||||
typedef std::map<std::string, Collada::Effect> EffectLibrary;
|
||||
EffectLibrary mEffectLibrary;
|
||||
|
||||
|
||||
/** Material library: surface material by ID */
|
||||
typedef std::map<std::string, Collada::Material> MaterialLibrary;
|
||||
MaterialLibrary mMaterialLibrary;
|
||||
|
||||
|
||||
/** Light library: surface light by ID */
|
||||
typedef std::map<std::string, Collada::Light> LightLibrary;
|
||||
LightLibrary mLightLibrary;
|
||||
|
||||
|
||||
/** Camera library: surface material by ID */
|
||||
typedef std::map<std::string, Collada::Camera> CameraLibrary;
|
||||
CameraLibrary mCameraLibrary;
|
||||
|
||||
|
||||
/** Controller library: joint controllers by ID */
|
||||
typedef std::map<std::string, Collada::Controller> ControllerLibrary;
|
||||
ControllerLibrary mControllerLibrary;
|
||||
|
@ -326,24 +326,24 @@ namespace Assimp
|
|||
/** Animation clip library: clip animation references by ID */
|
||||
typedef std::vector<std::pair<std::string, std::vector<std::string> > > AnimationClipLibrary;
|
||||
AnimationClipLibrary mAnimationClipLibrary;
|
||||
|
||||
|
||||
/** Pointer to the root node. Don't delete, it just points to one of
|
||||
the nodes in the node library. */
|
||||
Collada::Node* mRootNode;
|
||||
|
||||
|
||||
/** Root animation container */
|
||||
Collada::Animation mAnims;
|
||||
|
||||
|
||||
/** Size unit: how large compared to a meter */
|
||||
float mUnitSize;
|
||||
|
||||
|
||||
/** Which is the up vector */
|
||||
enum { UP_X, UP_Y, UP_Z } mUpDirection;
|
||||
|
||||
|
||||
/** Collada file format version */
|
||||
Collada::FormatVersion mFormat;
|
||||
};
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Check for element match
|
||||
inline bool ColladaParser::IsElement( const char* pName) const
|
||||
|
@ -351,7 +351,7 @@ namespace Assimp
|
|||
ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT);
|
||||
return ::strcmp( mReader->getNodeName(), pName) == 0;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Finds the item in the given library by its reference, throws if not found
|
||||
template <typename Type>
|
||||
|
@ -362,7 +362,7 @@ namespace Assimp
|
|||
ThrowException( boost::str( boost::format( "Unable to resolve library reference \"%s\".") % pURL));
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace Assimp
|
||||
|
||||
#endif // AI_COLLADAPARSER_H_INC
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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];
|
||||
|
@ -841,7 +841,7 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags)
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess, bool requestValidation ) {
|
||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||
|
||||
|
||||
// Return immediately if no scene is active
|
||||
if ( NULL == pimpl->mScene ) {
|
||||
return NULL;
|
||||
|
@ -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" );
|
||||
|
@ -908,7 +908,7 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
|
|||
DefaultLogger::get()->info( "Leaving customized post processing pipeline" );
|
||||
|
||||
ASSIMP_END_EXCEPTION_REGION( const aiScene* );
|
||||
|
||||
|
||||
return pimpl->mScene;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
@ -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 + "." );
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Ogre
|
|||
{
|
||||
|
||||
typedef Assimp::StreamReaderLE MemoryStreamReader;
|
||||
typedef boost::shared_ptr<MemoryStreamReader> MemoryStreamReaderPtr;
|
||||
typedef std::shared_ptr<MemoryStreamReader> MemoryStreamReaderPtr;
|
||||
|
||||
class OgreBinarySerializer
|
||||
{
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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)");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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 + ".");
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -428,12 +428,12 @@ namespace glTF
|
|||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct Target
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct Sampler
|
||||
{
|
||||
|
||||
|
@ -467,7 +467,7 @@ namespace glTF
|
|||
void Read(Value& obj, Asset& r);
|
||||
|
||||
void LoadFromStream(IOStream& stream, size_t length = 0, size_t baseOffset = 0);
|
||||
|
||||
|
||||
size_t AppendData(uint8_t* data, size_t length);
|
||||
void Grow(size_t amount);
|
||||
|
||||
|
@ -476,7 +476,7 @@ namespace glTF
|
|||
|
||||
void MarkAsSpecial()
|
||||
{ mIsSpecial = true; }
|
||||
|
||||
|
||||
bool IsSpecial() const
|
||||
{ return mIsSpecial; }
|
||||
};
|
||||
|
@ -553,7 +553,7 @@ namespace glTF
|
|||
|
||||
inline size_t GetDataLength() const
|
||||
{ return mDataLength; }
|
||||
|
||||
|
||||
inline const uint8_t* GetData() const
|
||||
{ return mData; }
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
@ -76,7 +74,7 @@ static const aiImporterDesc desc = {
|
|||
"gltf glb"
|
||||
};
|
||||
|
||||
glTFImporter::glTFImporter()
|
||||
glTFImporter::glTFImporter()
|
||||
: BaseImporter()
|
||||
, meshOffsets()
|
||||
, embeddedTexIdxs()
|
||||
|
@ -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
|
||||
|
@ -377,7 +375,7 @@ void glTFImporter::ImportMeshes(glTF::Asset& r)
|
|||
}
|
||||
|
||||
meshOffsets.push_back(k);
|
||||
|
||||
|
||||
CopyVector(meshes, mScene->mMeshes, mScene->mNumMeshes);
|
||||
}
|
||||
|
||||
|
@ -394,7 +392,7 @@ void glTFImporter::ImportCameras(glTF::Asset& r)
|
|||
aiCamera* aicam = mScene->mCameras[i] = new aiCamera();
|
||||
|
||||
if (cam.type == Camera::Perspective) {
|
||||
|
||||
|
||||
aicam->mAspect = cam.perspective.aspectRatio;
|
||||
aicam->mHorizontalFOV = cam.perspective.yfov * aicam->mAspect;
|
||||
aicam->mClipPlaneFar = cam.perspective.zfar;
|
||||
|
@ -435,7 +433,7 @@ void glTFImporter::ImportLights(glTF::Asset& r)
|
|||
CopyValue(l.color, ail->mColorAmbient);
|
||||
CopyValue(l.color, ail->mColorDiffuse);
|
||||
CopyValue(l.color, ail->mColorSpecular);
|
||||
|
||||
|
||||
ail->mAngleOuterCone = l.falloffAngle;
|
||||
ail->mAngleInnerCone = l.falloffExponent; // TODO fix this, it does not look right at all
|
||||
|
||||
|
@ -598,7 +596,7 @@ void glTFImporter::ImportEmbeddedTextures(glTF::Asset& r)
|
|||
void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) {
|
||||
|
||||
this->mScene = pScene;
|
||||
|
||||
|
||||
// read the asset file
|
||||
glTF::Asset asset(pIOHandler);
|
||||
asset.Load(pFile, GetExtension(pFile) == "glb");
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue