| 1 | /**************************************************************************** |
| 2 | * VCGLib o o * |
| 3 | * Visual and Computer Graphics Library o o * |
| 4 | * _ O _ * |
| 5 | * Copyright(C) 2004 \/)\/ * |
| 6 | * Visual Computing Lab /\/| * |
| 7 | * ISTI - Italian National Research Council | * |
| 8 | * \ * |
| 9 | * All rights reserved. * |
| 10 | * * |
| 11 | * This program is free software; you can redistribute it and/or modify * |
| 12 | * it under the terms of the GNU General Public License as published by * |
| 13 | * the Free Software Foundation; either version 2 of the License, or * |
| 14 | * (at your option) any later version. * |
| 15 | * * |
| 16 | * This program is distributed in the hope that it will be useful, * |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 19 | * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * |
| 20 | * for more details. * |
| 21 | * * |
| 22 | ****************************************************************************/ |
| 23 | /**************************************************************************** |
| 24 | History |
| 25 | |
| 26 | $Log: callback.h,v $ |
| 27 | Revision 1.4 2004/07/15 11:00:39 ganovelli |
| 28 | added interruptible callback |
| 29 | |
| 30 | Revision 1.3 2004/05/12 10:18:55 ganovelli |
| 31 | new line added at the end of file |
| 32 | |
| 33 | Revision 1.2 2004/05/10 14:26:33 ganovelli |
| 34 | argument name removed to avoid "unreference variable"warning |
| 35 | |
| 36 | Revision 1.1 2004/03/03 15:00:51 cignoni |
| 37 | Initial commit |
| 38 | |
| 39 | ****************************************************************************/ |
| 40 | |
| 41 | #ifndef __VCGLIB_CALLBACK |
| 42 | #define __VCGLIB_CALLBACK |
| 43 | |
| 44 | namespace vcg { |
| 45 | // Generic Callback function: |
| 46 | // Used to make algorithms interumpable |
| 47 | // Return value: true continue, false break |
| 48 | // The second callback is to know where we are (useful for progress bar) |
| 49 | typedef bool CallBack( const char * str ); |
| 50 | typedef bool CallBackPos(const int pos, const char * str ); |
| 51 | |
| 52 | inline bool DummyCallBack( const char * ) {return true;} |
| 53 | inline bool DummyCallBackPos(const int , const char * ) {return true;} |
| 54 | |
| 55 | /// interruptible function |
| 56 | typedef void TaskFunc(int t,void * contest); |
| 57 | |
| 58 | } // End namespace |
| 59 | |
| 60 | |
| 61 | #endif |