Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __VCG_EXCEPTION_H
00024 #define __VCG_EXCEPTION_H
00025
00026 namespace vcg
00027 {
00028 class MissingComponentException : public std::runtime_error
00029 {
00030 public:
00031 MissingComponentException(const std::string &err):std::runtime_error(err)
00032 {
00033 std::cout << "Missing Component Exception -" << err << "- \n";
00034 }
00035 virtual const char *what() const throw ()
00036 {
00037 static char buf[128]="Missing Component";
00038 return buf;
00039 }
00040 };
00041
00042 class MissingCompactnessException : public std::runtime_error
00043 {
00044 public:
00045 MissingCompactnessException(const std::string &err):std::runtime_error(err)
00046 {
00047 std::cout << "Lack of Compactness Exception -" << err << "- \n";
00048 }
00049 virtual const char *what() const throw ()
00050 {
00051 static char buf[128]="Lack of Compactness";
00052 return buf;
00053 }
00054 };
00055
00056 class MissingTriangularRequirementException : public std::runtime_error
00057 {
00058 public:
00059 MissingTriangularRequirementException(const std::string &err):std::runtime_error(err)
00060 {
00061 std::cout << "Mesh has to be composed by triangle and not polygons -" << err << "- \n";
00062 }
00063
00064 virtual const char *what() const throw ()
00065 {
00066 static char buf[128]="Mesh has to be composed by triangle and not polygons";
00067 return buf;
00068 }
00069 };
00070
00071 class MissingPolygonalRequirementException : public std::runtime_error
00072 {
00073 public:
00074 MissingPolygonalRequirementException(const std::string &err):std::runtime_error(err)
00075 {
00076 std::cout << "Mesh has to be composed by polygonal faces (not plain triangles) -" << err << "- \n";
00077 }
00078
00079 virtual const char *what() const throw ()
00080 {
00081 static char buf[128]="Mesh has to be composed by polygonal faces (not plain triangles) ";
00082 return buf;
00083 }
00084 };
00085
00086 class MissingPreconditionException : public std::runtime_error
00087 {
00088 public:
00089 MissingPreconditionException(const std::string &err):std::runtime_error(err)
00090 {
00091 std::cout << "Mesh does not satisfy the following precondition:" << err << "- \n";
00092 }
00093
00094 virtual const char *what() const throw ()
00095 {
00096 static char buf[128]="Mesh does not satisfy precondition";
00097 return buf;
00098 }
00099 };
00100
00101 }
00102 #endif // EXCEPTION_H