Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gunu_divide.h

Go to the documentation of this file.
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_DIVIDE_H
00021 #define GUNU_DIVIDE_H
00022 
00023 namespace gunu {
00024 
00025 using gul::Ptr;
00026 using gul::curve;
00027 using gul::surface;
00028 
00029 /*----------------------------------------------------------------------
00030   Splits a NURBS curve at point 'u' into two parts
00031 ----------------------------------------------------------------------- */ 
00032 template< class T, class HP >
00033 void SplitCurve( const curve<T,HP> *Curve, const T u,
00034                  curve<T,HP> *C1, curve<T,HP> *C2 );
00035 
00036 /*----------------------------------------------------------------------
00037   Splits a NURBS surface at point (u,v) into four parts
00038 ----------------------------------------------------------------------- */ 
00039 template< class T, class HP >
00040 void SplitSurface( 
00041             const surface<T,HP> *Surf, const T u, const T v, 
00042             surface<T,HP> *S11, surface<T,HP> *S12, 
00043             surface<T,HP> *S21, surface<T,HP> *S22 );
00044 
00045 /*----------------------------------------------------------------------
00046   Extracts a part of a NURBS curve (ranging from 'u1' to 'u2')
00047 ----------------------------------------------------------------------*/  
00048 template< class T, class HP >
00049 GULAPI void ExtractCurve( 
00050          const T u1, const T u2,
00051          const int n, const int p, 
00052          Ptr< T > U, Ptr< HP > Pw,
00053          int *retn, Ptr< T > *retU, Ptr< HP > *retPw );
00054 
00055 // plus normalization afterwards
00056 template< class T, class HP >
00057 inline void ExtractCurveN( 
00058          const T u1, const T u2,
00059          const int n, const int p, 
00060          Ptr< T > U, Ptr< HP > Pw,
00061          int *retn, Ptr< T > *retU, Ptr< HP > *retPw )
00062 {
00063   ExtractCurve<T,HP>( u1, u2, n, p, U, Pw, retn, retU, retPw );
00064   NormalizeKnotVector( *retn, p, *retU );
00065 }
00066 
00067 /*----------------------------------------------------------------------
00068   Extracts a part of a NURBS surface (ranging from 'u1' to 'u2' and 
00069   'v1' to 'v2')
00070 ----------------------------------------------------------------------*/  
00071 template< class T, class HP >
00072 GULAPI void ExtractSurface( 
00073          const T u1, const T u2,
00074          const T v1, const T v2,
00075          const int nu, const int pu, Ptr< T > U,
00076          const int nv, const int pv, Ptr< T > V,
00077          Ptr< Ptr< HP > > Pw,
00078          int *ret_nu, Ptr< T > *retU, 
00079          int *ret_nv, Ptr< T > *retV, 
00080          Ptr< Ptr< HP > > *retPw );
00081 
00082 // plus normalization afterwards
00083 template< class T, class HP >
00084 inline void ExtractSurfaceN( 
00085          const T u1, const T u2,
00086          const T v1, const T v2,
00087          const int nu, const int pu, Ptr< T > U,
00088          const int nv, const int pv, Ptr< T > V,
00089          Ptr< Ptr< HP > > Pw,
00090          int *ret_nu, Ptr< T > *retU, 
00091          int *ret_nv, Ptr< T > *retV, 
00092          Ptr< Ptr< HP > > *retPw )
00093 {
00094   ExtractSurface<T,HP>( u1, u2, v1, v2, nu, pu, U, nv, pv, V, Pw,
00095                         ret_nu, retU, ret_nv, retV, retPw );
00096 
00097   NormalizeKnotVector( *ret_nu, pu, *retU );
00098   NormalizeKnotVector( *ret_nv, pv, *retV );
00099 }
00100 
00101 
00102 }
00103 
00104 #endif     

Generated on Mon Jan 21 04:17:37 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001