Clipper: Use std::function for Z fill callback

This commit is contained in:
Roberto Fernandez Bautista 2021-05-25 09:33:53 +01:00 committed by Jon Evans
parent 83263784ea
commit cad27f9baa
2 changed files with 4 additions and 3 deletions

View File

@ -2763,7 +2763,7 @@ void Clipper::SetZ( IntPoint& pt, TEdge& e1, TEdge& e2 )
else if( pt == e2.Top )
pt.Z = e2.Top.Z;
else
(*m_ZFill)( e1.Bot, e1.Top, e2.Bot, e2.Top, pt );
m_ZFill( e1.Bot, e1.Top, e2.Bot, e2.Top, pt );
}

View File

@ -49,6 +49,7 @@
// use_deprecated: Enables temporary support for the obsolete functions
// #define use_deprecated
#include <functional>
#include <vector>
#include <list>
#include <set>
@ -142,8 +143,8 @@ struct DoublePoint
// ------------------------------------------------------------------------------
#ifdef use_xyz
typedef void (* ZFillCallback)( IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top,
IntPoint& pt );
typedef std::function<void( IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top,
IntPoint& pt )> ZFillCallback;
#endif
enum InitOptions