exception.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 * VCGLib                                                            o o     *
00003 * Visual and Computer Graphics Library                            o     o   *
00004 *                                                                _   O  _   *
00005 * Copyright(C) 2004-2012                                           \/)\/    *
00006 * Visual Computing Lab                                            /\/|      *
00007 * ISTI - Italian National Research Council                           |      *
00008 *                                                                    \      *
00009 * All rights reserved.                                                      *
00010 *                                                                           *
00011 * This program is free software; you can redistribute it and/or modify      *
00012 * it under the terms of the GNU General Public License as published by      *
00013 * the Free Software Foundation; either version 2 of the License, or         *
00014 * (at your option) any later version.                                       *
00015 *                                                                           *
00016 * This program is distributed in the hope that it will be useful,           *
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
00020 * for more details.                                                         *
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 } // end namespace vcg
00102 #endif // EXCEPTION_H


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:30:49