- if onlyshape is true then the merge is allowed based on the shape only
- otherwise the texture/shader references of faces in the same plane have to
- be the same as well.
- =============
- */
-brush_t *Brush_MergeList( brush_t *brushlist, int onlyshape ){
- brush_t *brush1, *brush2, *brush3, *newbrush;
- face_t *face1, *face2, *face3, *newface, *f;
+ SceneChangeNotify();
+}
+
+template<typename Type>
+class RemoveReference
+{
+public:
+typedef Type type;
+};
+
+template<typename Type>
+class RemoveReference<Type&>
+{
+public:
+typedef Type type;
+};
+
+template<typename Functor>
+class Dereference
+{
+const Functor& functor;
+public:
+Dereference( const Functor& functor ) : functor( functor ){
+}
+get_result_type<Functor> operator()( typename RemoveReference<get_argument<Functor, 0>>::type *firstArgument ) const {
+ return functor( *firstArgument );
+}
+};
+
+template<typename Functor>
+inline Dereference<Functor> makeDereference( const Functor& functor ){
+ return Dereference<Functor>( functor );
+}
+
+template<typename Caller>
+class BindArguments1
+{
+typedef get_argument<Caller, 1> FirstBound;
+FirstBound firstBound;
+public:
+BindArguments1( FirstBound firstBound )
+ : firstBound( firstBound ){
+}
+
+get_result_type<Caller> operator()( get_argument<Caller, 0> firstArgument ) const {
+ return Caller::call( firstArgument, firstBound );
+}
+};
+
+template<typename Caller>
+class BindArguments2
+{
+typedef get_argument<Caller, 1> FirstBound;
+typedef get_argument<Caller, 2> SecondBound;
+FirstBound firstBound;
+SecondBound secondBound;
+public:
+BindArguments2( FirstBound firstBound, SecondBound secondBound )
+ : firstBound( firstBound ), secondBound( secondBound ){
+}
+
+get_result_type<Caller> operator()( get_argument<Caller, 0> firstArgument ) const {
+ return Caller::call( firstArgument, firstBound, secondBound );
+}
+};
+
+template<typename Caller, typename FirstBound, typename SecondBound>
+BindArguments2<Caller> bindArguments( const Caller& caller, FirstBound firstBound, SecondBound secondBound ){
+ return BindArguments2<Caller>( firstBound, secondBound );
+}
+
+inline bool Face_testPlane( const Face& face, const Plane3& plane, bool flipped ){
+ return face.contributes() && !Winding_TestPlane( face.getWinding(), plane, flipped );
+}