Main Page   Class Hierarchy   Compound List   File List   Compound Members  

nurbs_global.h

00001 /*=============================================================================
00002         File: global.h
00003      Purpose: Define and include some general definitions valid for all 
00004               matrix header files
00005     Revision: $Id: nurbs_global.h,v 1.2 2002/05/13 21:07:46 philosophil Exp $
00006   Created by: Philippe Lavoie          (3 Oct, 1996)
00007  Modified by: 
00008 
00009  Copyright notice:
00010           Copyright (C) 1996-1998 Philippe Lavoie
00011  
00012           This library is free software; you can redistribute it and/or
00013           modify it under the terms of the GNU Library General Public
00014           License as published by the Free Software Foundation; either
00015           version 2 of the License, or (at your option) any later version.
00016  
00017           This library is distributed in the hope that it will be useful,
00018           but WITHOUT ANY WARRANTY; without even the implied warranty of
00019           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020           Library General Public License for more details.
00021  
00022           You should have received a copy of the GNU Library General Public
00023           License along with this library; if not, write to the Free
00024           Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00025 =============================================================================*/
00026 #ifndef _Matrix_internals_h_
00027 #define _Matrix_internals_h_
00028 
00029 #include "matrix_global.h"
00030 
00031 enum CoordinateType { coordX, coordY, coordZ } ;
00032 
00033 #include <iostream>
00034 #include <cstdlib>
00035 
00048 struct NurbsError {
00049   NurbsError() { print_debug(); }
00050   void print_debug(){
00051 #ifdef VERBOSE_EXCEPTION
00052     print();
00053 #else
00054     ;
00055 #endif
00056   }
00057   virtual void print() { cerr << "NURBS error.\n" ; }
00058 };
00059 
00075 struct NurbsInputError : public NurbsError {
00076   NurbsInputError(): mode(0),x(0),y(0) { print_debug() ; }
00077   NurbsInputError(int a, int b): mode(1),x(a),y(b) { print_debug() ; }
00078   virtual void print() { 
00079     if(mode==1) cerr << "The values " << x << " and " << y << " are not equal.\n" ; 
00080     else cerr << "An error in one of  the input parameter.\n" ; }
00081   int mode ;
00082   int x,y ;
00083 };
00084 
00097 struct NurbsSizeError : public NurbsInputError {
00098   NurbsSizeError(int pnts, int knots, int deg) : p(pnts), k(knots), d(deg) { print_debug();}
00099   virtual void print() { cerr << " The number of knots (" << k << "), the number of control points ("<< p << ") and the degree ("<< d << ") are not compatible.\n" ; }
00100   int p,k,d ;
00101 };
00102 
00112 struct NurbsComputationError : public NurbsError {
00113   NurbsComputationError() { print_debug(); }
00114   virtual void print() { cerr << "Couldn't not succesfully perform the computation.\n" ; }
00115 };
00116 
00127 struct NurbsWarning : public NurbsError {
00128   NurbsWarning() { print_debug(); }
00129   virtual void print() { cerr << "A non-critical error occured.\n" ; }
00130 };
00131 
00132 
00133 #endif 
00134 

Generated on Tue Jun 24 13:26:57 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002