00001 /* LIBGUL - Geometry Utility Library 00002 * Copyright (C) 1998-1999 Norbert Irmer 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this library; if not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 * Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef GUNU_INTERPOLATE_H 00021 #define GUNU_INTERPOLATE_H 00022 00023 namespace gunu { 00024 00025 /*---------------------------------------------------------------------- 00026 Calculates the control points of a cubic curve, interpolating 00027 the data points Q0,..,Qn. (see "The NURBS Book") 00028 The knot vector U must be computed by the caller. 00029 The first and last two control points P0,P1,Pn+1,Pn+2, depend 00030 on the directions & magnitudes of the curve endpoint derivatives, 00031 and must be filled in by the caller too. 00032 ----------------------------------------------------------------------*/ 00033 template< class T > 00034 GULAPI void CubicCurveInterpolation( int n, Ptr<point<T> > Q, Ptr<T> U, 00035 Ptr<point<T> > P ); 00036 00037 /*----------------------------------------------------------------------- 00038 Creates a non-homogeneous NURBS curve, which interpolates a set of 'n+1' 00039 data points 'Q' with "Local Bicubic Interpolation" (see "The NURBS Book"). 00040 For each data point two control points are generated. Storage for 00041 the output arrays 'U' and 'P' must be reserved by the caller: 00042 00043 For P: (n+1)*2 00044 For U: ((n+1)*2 + 4) 00045 -------------------------------------------------------------------- */ 00046 template< class K > 00047 GULAPI void CubicLocalCurveInterpolation( 00048 int n, Ptr< point<K> > Q, bool cornerflag, 00049 Ptr<K> U, Ptr< point<K> > P ); 00050 00051 /*----------------------------------------------------------------------- 00052 Creates a non-homogeneous NURBS surface, which interpolates a net of 00053 'm+1' * 'n+1' data points 'Q' with "Local Bicubic Interpolation" 00054 (see "The NURBS Book"). For each data point two control points are generated. Storage for 00055 the output arrays 'U','V' and 'controlPoints' must be reserved by the caller: 00056 00057 For controlPoints: (m+1)*(n+1)*2*sizeof(NUPoint) 00058 For U: ((n+1)*2 + 4) 00059 For V: ((m+1)*2 + 4) 00060 -------------------------------------------------------------------- */ 00061 template< class T, class HP > 00062 GULAPI void CubicLocalSurfaceInterpolation( 00063 int n, int m, Ptr< Ptr< point<T> > > Q, bool cornerflag, 00064 Ptr<T> U, Ptr<T> V, Ptr< Ptr< HP > > controlPoints ); 00065 00066 } 00067 00068 #endif