~ubuntu-branches/ubuntu/lucid/meshlab/lucid

« back to all changes in this revision

Viewing changes to vcglib/img/img_base.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-10-08 16:40:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091008164041-0c2ealqv8b8uc20c
Tags: 1.2.2-1
* New upstream version
* Do not build filter_isoparametrization because liblevmar dependency
  is not (yet) in Debian
* Fix compilation with gcc-4.4, thanks to Jonathan Liu for the patch
  (closes: #539544)
* rules: Add compiler variables to the qmake call (for testing with new
  GCC versions)
* io_3ds.pro: Make LIBS and INCLUDEPATH point to Debian version of lib3ds
* io_epoch.pro: Make LIBS point to Debian version of libbz2
* control:
  - Move Homepage URL to the source package section
  - Update to standards-version 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef IMG_BASE_H_
 
2
#define IMG_BASE_H_
 
3
/*! \file img_base.h
 
4
    \brief basic definitions for the img module
 
5
 
 
6
    This header contains the basic module definitions.
 
7
*/
 
8
 
 
9
/// base of the static assertion mechanism
 
10
template<bool> struct NON_TRUE_EXPR_CompileTimeError;
 
11
/// partial instantiation for the static assertion mechanism
 
12
template<> struct NON_TRUE_EXPR_CompileTimeError<true> {};
 
13
 
 
14
/// the static assertion mechanism
 
15
#define STATIC_ASSERT(exp) (NON_TRUE_EXPR_CompileTimeError< (exp) >())  
 
16
 
 
17
/// base of the static typecheck mechanism
 
18
template<typename> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError;
 
19
/// partial instantiation for the static typecheck mechanism
 
20
template<> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError<float> {};
 
21
/// partial instantiation for the static typecheck mechanism
 
22
template<> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError<double> {};
 
23
 
 
24
/// the static typecheck mechanism
 
25
#define STATIC_FLOAT_OR_DOUBLE_TYPECHECK(type) (NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError< type >())
 
26
 
 
27
/// define NULL pointer value
 
28
#ifndef NULL
 
29
 #ifdef __cplusplus
 
30
  #define NULL 0
 
31
 #else
 
32
  #define NULL ((void *)0)
 
33
 #endif
 
34
#endif
 
35
 
 
36
#include <assert.h>
 
37
#include <math.h>
 
38
#include <exception>
 
39
#include <typeinfo>
 
40
 
 
41
/*! \brief the img module namespace
 
42
 
 
43
  this is the main image module namespace.
 
44
*/
 
45
namespace img {
 
46
 
 
47
/*! \brief the basic exception class
 
48
 
 
49
  this is the basic image exception class, it simply carries an error string to the console.
 
50
*/
 
51
class ImageException: public std::exception
 
52
{
 
53
public:
 
54
  /// the error string
 
55
  const char *message;
 
56
  /// default constructor
 
57
  ImageException():exception(),message("no message"){}
 
58
  /*! \brief message carrying constructor
 
59
 
 
60
    \param arg_message the error string
 
61
  */
 
62
  ImageException(const char *arg_message):exception(),message(arg_message){}
 
63
  /// the destructor
 
64
  virtual ~ImageException () throw (){}
 
65
};
 
66
 
 
67
} //end namespace img
 
68
 
 
69
#endif /*IMG_BASE_H_*/