Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ API
- MessageHandler : Added `msg()` overload that accepts a `fmt::format_string` and arguments.
- InternedString : Added specialisation for `fmt::formatter<InternedString>`.

Breaking Changes
----------------

- MessageHandler : Removed support for passing `boost::format` objects to `msg()`. Use `fmt::format()` instead.

Build
-----

Expand Down
4 changes: 0 additions & 4 deletions include/IECore/MessageHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "IECore/Export.h"
#include "IECore/RefCounted.h"

#include "boost/format.hpp"
#include "boost/noncopyable.hpp"

#include "fmt/format.h"
Expand Down Expand Up @@ -82,8 +81,6 @@ class IECORE_API MessageHandler : public RefCounted
//@{
/// Output a message to the current handler.
static void output( Level level, const std::string &context, const std::string &message );
/// Output a message to the current handler.
static void output( Level level, const std::string &context, const boost::format &message );
//@}

//! @name Default handler
Expand Down Expand Up @@ -156,7 +153,6 @@ typedef MessageHandler Msg;
/// Free functions which calls MessageHandler::output() with their arguments. These are provided
/// for brevity.
IECORE_API void msg( MessageHandler::Level level, const std::string &context, const std::string &message );
IECORE_API void msg( MessageHandler::Level level, const std::string &context, const boost::format &message );
/// Inline templated convenience function which formats the message using the provided arguments.
template <typename... Args>
inline void msg( MessageHandler::Level level, const std::string &context, fmt::format_string<Args...> message, Args&&... args )
Expand Down
11 changes: 0 additions & 11 deletions src/IECore/MessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ void MessageHandler::output( Level level, const std::string &context, const std:
currentHandler()->handle( level, context, message );
}

void MessageHandler::output( Level level, const std::string &context, const boost::format &message )
{
string m = message.str();
output( level, context, m );
}

///////////////////////////////////////////////////////////////////////////////////////
// default handler
///////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -173,8 +167,3 @@ void IECore::msg( MessageHandler::Level level, const std::string &context, const
{
MessageHandler::output( level, context, message );
}

void IECore::msg( MessageHandler::Level level, const std::string &context, const boost::format &message )
{
MessageHandler::output( level, context, message );
}
4 changes: 2 additions & 2 deletions src/IECoreGL/Selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class Selector::Implementation : public IECore::RefCounted
//////////////////////////////////////////////////////////////////////////

FrameBufferPtr m_frameBuffer;
boost::shared_ptr<FrameBuffer::ScopedBinding> m_frameBufferBinding;
std::unique_ptr<FrameBuffer::ScopedBinding> m_frameBufferBinding;
GLint m_prevProgram;
ConstShaderPtr m_currentIDShader;
std::stack<ConstShaderPtr> m_IDShaderStack;
Expand All @@ -325,7 +325,7 @@ class Selector::Implementation : public IECore::RefCounted
}
m_frameBuffer->setDepth( new DepthTexture( 128, 128 ) );
m_frameBuffer->validate();
m_frameBufferBinding = boost::shared_ptr<FrameBuffer::ScopedBinding>( new FrameBuffer::ScopedBinding( *m_frameBuffer ) );
m_frameBufferBinding = std::make_unique<FrameBuffer::ScopedBinding>( *m_frameBuffer );

glGetIntegerv( GL_VIEWPORT, m_prevViewport );
glViewport( 0, 0, 128, 128 );
Expand Down
6 changes: 4 additions & 2 deletions src/IECoreImage/ImagePrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

#include "boost/static_assert.hpp"

#include "fmt/format.h"

#include <cassert>

using namespace std;
Expand Down Expand Up @@ -406,7 +408,7 @@ bool ImagePrimitive::channelValid( const IECore::Data *data, std::string *reason
{
if( reason )
{
*reason = str( format( "Channel has wrong size (%d but should be %d)." ) % size % numPixels );
*reason = fmt::format( "Channel has wrong size ({} but should be {}).", size, numPixels );
}
return false;
}
Expand All @@ -421,7 +423,7 @@ bool ImagePrimitive::channelValid( const std::string &name, std::string *reason
{
if( reason )
{
*reason = str( format( "Channel \"%s\" does not exist." ) % name );
*reason = fmt::format( "Channel \"{}\" does not exist.", name );
}
return false;
}
Expand Down
8 changes: 3 additions & 5 deletions src/IECoreScene/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ class Font::Implementation : public IECore::RefCounted
V2f advance;
};

typedef boost::shared_ptr<Mesh> MeshPtr;
typedef boost::shared_ptr<const Mesh> ConstMeshPtr;
mutable std::vector<MeshPtr> m_meshes;
mutable std::vector<std::unique_ptr<Mesh>> m_meshes;

const Mesh *cachedMesh( char c ) const
{
Expand Down Expand Up @@ -511,11 +509,11 @@ class Font::Implementation : public IECore::RefCounted
transformOp->operate();

// put it in the cache
MeshPtr mesh( new Mesh );
auto &mesh = m_meshes[c];
mesh = std::make_unique<Mesh>();
mesh->primitive = primitive;
mesh->bound = primitive->bound();
mesh->advance = V2f( m_face->glyph->advance.x, m_face->glyph->advance.y ) / m_face->units_per_EM;
m_meshes[c] = mesh;

// return it
return mesh.get();
Expand Down
4 changes: 2 additions & 2 deletions src/IECoreScene/PDCParticleReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool PDCParticleReader::open()

if( m_header.version > 1 )
{
msg( Msg::Warning, "PDCParticleReader::open()", format( "File \"%s\" has unknown version %d." ) % fileName() % m_header.version );
msg( Msg::Warning, "PDCParticleReader::open()", "File \"{}\" has unknown version {}.", fileName(), m_header.version );
}

int unused = 0;
Expand Down Expand Up @@ -262,7 +262,7 @@ DataPtr PDCParticleReader::readAttribute( const std::string &name )
const Data *idAttr = idAttribute();
if ( !idAttr && particlePercentage() < 100.0f )
{
msg( Msg::Warning, "PDCParticleReader::filterAttr", format( "Percentage filtering requested but file \"%s\" contains no particle Id attribute." ) % fileName() );
msg( Msg::Warning, "PDCParticleReader::filterAttr", "Percentage filtering requested but file \"{}\" contains no particle Id attribute.", fileName() );
}

DataPtr result = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/IECoreScene/PDCParticleWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void PDCParticleWriter::doWrite( const CompoundObject *operands )
}
else
{
msg( Msg::Warning, "PDCParticleWriter::write", format( "Attribute \"%s\" is of unsupported type \"%s\"." ) % *it % attr->typeName() );
msg( Msg::Warning, "PDCParticleWriter::write", "Attribute \"{}\" is of unsupported type \"{}\".", *it, attr->typeName() );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/IECoreScene/ParticleReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ ObjectPtr ParticleReader::doOperation( const CompoundObject * operands )
}
else
{
msg( Msg::Warning, "ParticleReader::doOperation", format( "Ignoring attribute \"%s\" due to insufficient elements (expected %d but found %d)." ) % *it % result->getNumPoints() % s );
msg( Msg::Warning, "ParticleReader::doOperation", "Ignoring attribute \"{}\" due to insufficient elements (expected {} but found {}).", *it, result->getNumPoints(), s );
}
}
else if ( testTypedData<TypeTraits::IsSimpleTypedData>( d.get() ) )
Expand Down
4 changes: 2 additions & 2 deletions src/IECoreScene/ParticleWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void ParticleWriter::particleAttributes( std::vector<std::string> &names )
}
else
{
msg( Msg::Warning, "ParticleWriter::particleAttributes", format( "Ignoring attribute \"%s\" due to insufficient elements (expected %d but found %d)." ) % it->first % numParticles % s );
msg( Msg::Warning, "ParticleWriter::particleAttributes", "Ignoring attribute \"{}\" due to insufficient elements (expected {} but found {}).", it->first, numParticles, s );
}
}
else if ( testTypedData<TypeTraits::IsSimpleTypedData>( it->second.data.get() ) )
Expand Down Expand Up @@ -124,7 +124,7 @@ void ParticleWriter::particleAttributes( std::vector<std::string> &names )
}
else
{
msg( Msg::Warning, "ParticleWriter::particleAttributes", format( "Attribute \"%s\" requested via parameters but is not available." ) % *it );
msg( Msg::Warning, "ParticleWriter::particleAttributes", "Attribute \"{}\" requested via parameters but is not available.", *it );
}
}
}
2 changes: 0 additions & 2 deletions src/IECoreScene/PointsAlgoSegment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
#include "IECore/DespatchTypedData.h"
#include "IECore/TypeTraits.h"

#include "boost/format.hpp"

using namespace IECore;
using namespace IECoreScene;
using namespace Imath;
Expand Down