eg2holed.h

Go to the documentation of this file.
00001 
00002 /* ///////////////////////////////////////////////////////////////////////// */
00003 /* This file is a part of the BSTools package                                */
00004 /* written by Przemyslaw Kiciak                                              */
00005 /* ///////////////////////////////////////////////////////////////////////// */
00006 /* (C) Copyright by Przemyslaw Kiciak, 2005, 2010                            */
00007 /* this package is distributed under the terms of the                        */
00008 /* Lesser GNU Public License, see the file COPYING.LIB                       */
00009 /* ///////////////////////////////////////////////////////////////////////// */
00010 
00011 /* this header file is for application use */
00012 
00013 #ifndef EG2HOLED_H
00014 #define EG2HOLED_H
00015 
00016 #ifndef EGHOLED_H
00017 #include "egholed.h"
00018 #endif
00019 
00020 #ifdef __cplusplus   
00021 extern "C" {
00022 #endif
00023 
00024 #ifndef CONST_  /* a dirty trick to suppress many compiler warning messages */
00025 #define CONST_ const
00026 #endif
00027 
00028 #define G2H_FINALDEG  9
00029 
00030 #define G2H_OMCDEG 7  /* degree of common boundary curves */
00031 
00032 /* the following constants are related with the spline basis */
00033 #define G2H_S_MAX_NK  4
00034 #define G2H_S_MAX_M1  3
00035 #define G2H_S_MAX_M2  7
00036 
00037 /* ///////////////////////////////////////////////////////////////////////// */
00038 /* Below are the possible queries and answers for the option procedure. */
00039 /* It is always safe to return the "default" answer with no data. */
00040 
00041 #define G2H_DEFAULT                    0 /* default answer for all queries */
00042 
00043 #define G2HQUERY_CENTRAL_POINT         1
00044 #define G2H_CENTRAL_POINT_ALT          1
00045 #define G2H_CENTRAL_POINT_GIVEN        2
00046 
00047 #define G2HQUERY_CENTRAL_DERIVATIVES1  2
00048 #define G2H_CENRTAL_DERIVATIVES1_ALT   1
00049 #define G2H_CENTRAL_DERIVATIVES1_GIVEN 2
00050 
00051 #define G2HQUERY_DOMAIN_CURVES         3
00052 #define G2H_DOMAIN_CURVES_DEG4         1
00053 
00054 #define G2HQUERY_BASIS                 4
00055 #define G2H_USE_RESTRICTED_BASIS       1
00056 
00057 #define G2HQUERY_QUADRATURE            5
00058 #define G2H_QUADRATURE_GAUSS_LEGENDRE  1
00059 
00060 /* ///////////////////////////////////////////////////////////////////////// */
00061 /* core procedures */
00062 
00063 void g2h_SetOptionProcd ( GHoleDomaind *domain,
00064     int (*OptionProc)( GHoleDomaind *domain, int query, int qn,
00065                        int *ndata, int **idata, double **fdata ) );
00066 
00067 boolean g2h_ComputeBasisd ( GHoleDomaind *domain );
00068 
00069 boolean g2h_ComputeFormMatrixd ( GHoleDomaind *domain );
00070 boolean g2h_DecomposeMatrixd ( GHoleDomaind *domain );
00071 boolean g2h_FillHoled ( GHoleDomaind *domain,
00072                         int spdimen, CONST_ double *hole_cp,
00073                         double *acoeff, void *usrptr,
00074                         void (*outpatch) ( int n, int m, const double *cp,
00075                                            void *usrptr ) );
00076 
00077 boolean g2h_ComputeExtFormMatrixd ( GHoleDomaind *domain );
00078 boolean g2h_DecomposeExtMatrixd ( GHoleDomaind *domain );
00079 boolean g2h_ExtFillHoled ( GHoleDomaind *domain,
00080                            int spdimen, CONST_ double *hole_cp,
00081                            double *acoeff, void *usrptr,
00082                            void (*outpatch) ( int n, int m, const double *cp,
00083                                               void *usrptr ) );
00084 
00085 int g2h_V0SpaceDimd ( GHoleDomaind *domain );
00086 int g2h_ExtV0SpaceDimd ( GHoleDomaind *domain );
00087 boolean g2h_GetBPDerivativesd ( GHoleDomaind *domain, int cno, double *val );
00088 boolean g2h_GetBFuncPatchd ( GHoleDomaind *domain, int fn, int pn, double *bp );
00089 
00090 boolean g2h_SetConstraintMatrixd ( GHoleDomaind *domain,
00091                                    int nconstr, const double *cmat );
00092 boolean g2h_FillHoleConstrd ( GHoleDomaind *domain,
00093                               int spdimen, CONST_ double *hole_cp,
00094                               int nconstr, CONST_ double *constr,
00095                               double *acoeff, void *usrptr,
00096                               void (*outpatch) ( int n, int m, const double *cp,
00097                                                  void *usrptr ) );
00098 
00099 boolean g2h_SetAltConstraintMatrixd ( GHoleDomaind *domain, int spdimen,
00100                                       int nconstr, const double *cmat );
00101 boolean g2h_FillHoleAltConstrd ( GHoleDomaind *domain,
00102                               int spdimen, CONST_ double *hole_cp,
00103                               int naconstr, CONST_ double *constr,
00104                               double *acoeff, void *usrptr,
00105                               void (*outpatch) ( int n, int m, const double *cp,
00106                                                  void *usrptr ) );
00107 
00108 boolean g2h_SetExtConstraintMatrixd ( GHoleDomaind *domain,
00109                                       int nconstr, const double *cmat );
00110 boolean g2h_ExtFillHoleConstrd ( GHoleDomaind *domain,
00111                          int spdimen, CONST_ double *hole_cp,
00112                          int nconstr, CONST_ double *constr,
00113                          double *acoeff, void *usrptr,
00114                          void (*outpatch) ( int n, int m, const double *cp,
00115                                             void *usrptr ) );
00116 
00117 boolean g2h_SetExtAltConstraintMatrixd ( GHoleDomaind *domain, int spdimen,
00118                                       int naconstr, const double *acmat );
00119 boolean g2h_ExtFillHoleAltConstrd ( GHoleDomaind *domain,
00120                          int spdimen, CONST_ double *hole_cp,
00121                          int naconstr, CONST_ double *constr,
00122                          double *acoeff, void *usrptr,
00123                          void (*outpatch) ( int n, int m, const double *cp,
00124                                             void *usrptr ) );
00125 
00126 double g2h_FunctionalValued ( GHoleDomaind *domain, int spdimen,
00127                              CONST_ double *hole_cp, CONST_ double *acoeff );
00128 double g2h_ExtFunctionalValued ( GHoleDomaind *domain, int spdimen,
00129                                 CONST_ double *hole_cp, CONST_ double *acoeff );
00130 boolean g2h_NLFunctionalValued ( GHoleDomaind *domain,   
00131                                  const point3d *hole_cp, const vector3d *acoeff,
00132                                  double *funcval );
00133 boolean g2h_NLExtFunctionalValued ( GHoleDomaind *domain,
00134                                     const point3d *hole_cp, const vector3d *acoeff,
00135                                     double *funcval );
00136 
00137 /* ///////////////////////////////////////////////////////////////////////// */
00138 boolean g2h_ComputeNLNormald ( GHoleDomaind *domain, 
00139                                const point3d *hole_cp,
00140                                vector3d *anv );
00141 
00142 boolean g2h_NLFillHoled ( GHoleDomaind *domain, const point3d *hole_cp,
00143                           double *acoeff, void *usrptr,
00144                           void (*outpatch) ( int n, int m, const point3d *cp,
00145                                              void *usrptr ) );
00146 boolean g2h_NLFillHoleConstrd ( GHoleDomaind *domain, const point3d *hole_cp,   
00147                     int nconstr, const vector3d *constr,
00148                     double *acoeff, void *usrptr,
00149                     void (*outpatch) ( int n, int m, const point3d *cp,
00150                                        void *usrptr ) );
00151 boolean g2h_NLFillHoleAltConstrd ( GHoleDomaind *domain, const point3d *hole_cp,
00152                     int nconstr, const double *constr,
00153                     double *acoeff, void *usrptr,
00154                     void (*outpatch) ( int n, int m, const point3d *cp,
00155                                        void *usrptr ) );
00156 
00157 boolean g2h_NLExtFillHoled ( GHoleDomaind *domain, const point3d *hole_cp,
00158                              double *acoeff, void *usrptr,
00159                              void (*outpatch) ( int n, int m, const point3d *cp,
00160                                                 void *usrptr ) );
00161 boolean g2h_NLExtFillHoleConstrd ( GHoleDomaind *domain,
00162                      const point3d *hole_cp,
00163                      int nconstr, const vector3d *constr,
00164                      double *acoeff, void *usrptr,
00165                      void (*outpatch) ( int n, int m, const point3d *cp,
00166                                         void *usrptr ) );
00167 boolean g2h_NLExtFillHoleAltConstrd ( GHoleDomaind *domain, const point3d *hole_cp,
00168                          int naconstr, const double *constr,
00169                          double *acoeff, void *usrptr,
00170                          void (*outpatch) ( int n, int m, const point3d *cp,
00171                                             void *usrptr ) ); 
00172 
00173 boolean g2h_NLSplFillHoled ( GHoleDomaind *domain, const point3d *hole_cp,
00174                      double *acoeff, void *usrptr,
00175                      void (*outpatch) ( int n, int lknu, const double *knu,
00176                                         int m, int lknv, const double *knv,
00177                                         const point3d *cp, void *usrptr ) );
00178 boolean g2h_NLSplFillHoleConstrd ( GHoleDomaind *domain, const point3d *hole_cp,
00179                      int nconstr, const vector3d *constr,
00180                      double *acoeff, void *usrptr,
00181                      void (*outpatch) ( int n, int lknu, const double *knu,
00182                                         int m, int lknv, const double *knv,
00183                                         const point3d *cp, void *usrptr ) );
00184 boolean g2h_NLSplFillHoleAltConstrd ( GHoleDomaind *domain, const point3d *hole_cp,
00185                      int nconstr, const double *constr,
00186                      double *acoeff, void *usrptr,
00187                      void (*outpatch) ( int n, int lknu, const double *knu,
00188                                         int m, int lknv, const double *knv,
00189                                         const point3d *cp, void *usrptr ) );
00190 
00191 /* ///////////////////////////////////////////////////////////////////////// */
00192 boolean g2h_GetFinalPatchCurvesd ( GHoleDomaind *domain, int spdimen,
00193                                    CONST_ double *hole_cp, double *acoeff,
00194                                    void (*outcurve) ( int n, const double *cp ) );
00195 boolean g2h_GetExtFinalPatchCurvesd ( GHoleDomaind *domain, int spdimen,
00196                                       CONST_ double *hole_cp, double *acoeff,
00197                                       void (*outcurve) ( int n, const double *cp ) );
00198 boolean g2h_GetSplFinalPatchCurvesd ( GHoleDomaind *domain, int spdimen,
00199                                       CONST_ double *hole_cp, double *acoeff,
00200                                       void (*outcurve) ( int n, int lkn,
00201                                                const double *kn, const double *cp ) );
00202 
00203 /* ///////////////////////////////////////////////////////////////////////// */
00204 /* spline basis procedures */
00205 boolean g2h_ComputeSplBasisd ( GHoleDomaind *domain, int nk, int m1, int m2 );
00206 boolean g2h_ComputeSplFormMatrixd ( GHoleDomaind *domain );
00207 boolean g2h_DecomposeSplMatrixd ( GHoleDomaind *domain );
00208 boolean g2h_SplFillHoled ( GHoleDomaind *domain,
00209                int spdimen, CONST_ double *hole_cp,
00210                double *acoeff, void *usrptr,
00211                void (*outpatch) ( int n, int lknu, const double *knu,
00212                                   int m, int lknv, const double *knv,            
00213                                   const double *cp, void *usrptr ) );
00214 
00215 int g2h_SplV0SpaceDimd ( GHoleDomaind *domain );
00216 boolean g2h_SetSplConstraintMatrixd ( GHoleDomaind *domain,
00217                                       int nconstr, const double *cmat );
00218 boolean g2h_SplFillHoleConstrd ( GHoleDomaind *domain,
00219                int spdimen, CONST_ double *hole_cp,
00220                int nconstr, CONST_ double *constr,
00221                double *acoeff, void *usrptr,
00222                void (*outpatch) ( int n, int lknu, const double *knu,
00223                                   int m, int lknv, const double *knv,
00224                                   const double *cp, void *usrptr ) );
00225 
00226 boolean g2h_SetSplAltConstraintMatrixd ( GHoleDomaind *domain, int spdimen,
00227                                          int naconstr, const double *acmat );
00228 boolean g2h_SplFillHoleAltConstrd ( GHoleDomaind *domain,
00229                int spdimen, CONST_ double *hole_cp,
00230                int naconstr, CONST_ double *constr,
00231                double *acoeff, void *usrptr,
00232                void (*outpatch) ( int n, int lknu, const double *knu,
00233                                   int m, int lknv, const double *knv,
00234                                   const double *cp, void *usrptr ) );
00235 
00236 /* ///////////////////////////////////////////////////////////////////////// */
00237 /* drawing procedures */
00238 void g2h_DrawDomAuxPatchesd ( GHoleDomaind *domain,
00239                void (*drawpatch) ( int n, int m, const point2d *cp ) );
00240 void g2h_DrawBasAuxPatchesd ( GHoleDomaind *domain, int fn,
00241                void (*drawpatch) ( int n, int m, const double *cp ) );
00242 void g2h_DrawJFunctiond ( GHoleDomaind *domain, int k, int l,
00243                           void (*drawpoly) ( int deg, const double *f ) );
00244 void g2h_DrawDiPatchesd ( GHoleDomaind *domain,
00245                       void (*drawpatch) ( int n, int m, const point2d *cp ) );
00246 void g2h_ExtractPartitiond ( GHoleDomaind *domain,
00247                              int *hole_k, int *hole_m,
00248                              double *partition,
00249                              double *part_delta,
00250                              double *spart_alpha,
00251                              double *spart_malpha,
00252                              double *spart_salpha,
00253                              double *spart_knot,
00254                              double *alpha0,
00255                              boolean *spart_sgn,
00256                              boolean *spart_both );
00257 void g2h_ExtractCentralPointd ( GHoleDomaind *domain,
00258                                 point2d *centp, vector2d *centder );
00259 void g2h_DrawBasAFunctiond ( GHoleDomaind *domain, int fn,
00260                void (*drawpatch) ( int n, int m, const point3d *cp ) );
00261 void g2h_DrawBasBFunctiond ( GHoleDomaind *domain, int fn,
00262                void (*drawpatch) ( int n, int m, const point3d *cp ) );
00263 void g2h_DrawBasCNetd ( GHoleDomaind *domain, int fn,
00264                void (*drawnet) ( int n, int m, const point3d *cp ) );
00265 void g2h_DrawBFAomcd ( GHoleDomaind *domain, int fn, 
00266                        void (*drawpoly)(int degree, const double *coeff) );
00267 void g2h_DrawBFBomcd ( GHoleDomaind *domain, int fn,
00268                        void (*drawpoly)(int degree, const double *coeff) );
00269 void g2h_DrawFinalSurfBCd ( GHoleDomaind *domain,   
00270                             int spdimen, const double *hole_cp,
00271                             const double *acoeff, 
00272                             void (*drawcurve)(int degree, int spdimen,
00273                                               const double *cp) );
00274 void g2h_ExtDrawFinalSurfBCd ( GHoleDomaind *domain,
00275                                int spdimen, const double *hole_cp,
00276                                const double *acoeff, 
00277                                void (*drawcurve)(int degree, int spdimen,
00278                                                  const double *cp) );
00279 void g2h_DrawMatricesd ( GHoleDomaind *domain,
00280                          void (*drawmatrix)(int nfa, int nfb,
00281                                             double *amat, double *bmat) );
00282 void g2h_DrawExtMatricesd ( GHoleDomaind *domain,
00283                             void (*drawmatrix)(int k, int r, int s,
00284                                                double *Aii, double *Bi) );
00285 int g2h_DrawBFcpnd ( int hole_k, unsigned char *bfcpn );
00286 
00287 boolean g2h_GetABasisFPatchCurved ( GHoleDomaind *domain, int fn, int i,
00288                                     double *bfpc );
00289 boolean g2h_GetBBasisFPatchCurved ( GHoleDomaind *domain, int fn, int i,
00290                                     double *bfpc );
00291 
00292 /* ///////////////////////////////////////////////////////////////////////// */
00293 /* spline basis drawing procedures */
00294 void g2h_DrawSplBasFuncNumd ( GHoleDomaind *domain,
00295                         int *nfunc_a, int *nfunc_b, int *nfunc_c, int *nfunc_d );
00296 
00297 void g2h_DrawSplBasAuxPatchesd ( GHoleDomaind *domain, int fn,
00298                void (*drawpatch) ( int n, int lknu, const double *knu,
00299                                    int m, int lknv, const double *knv,
00300                                    const point3d *cp ) );
00301 
00302 void g2h_DrawSplBasFunctiond ( GHoleDomaind *domain, int fn,
00303              void (*drawpatch) ( int n, int lknu, const double *knu,
00304                                  int m, int lknv, const double *knv,
00305                                  const point3d *cp ) );
00306 
00307 void g2h_DrawSplBFAomcd ( GHoleDomaind *domain, int fn,
00308                           void (*drawpoly)(int degree, int lastknot,
00309                                            const double *knots,
00310                                            const double *coeff) );
00311 void g2h_DrawSplBFBomcd ( GHoleDomaind *domain, int fn,
00312                           void (*drawpoly)(int degree, int lastknot,
00313                                            const double *knots,
00314                                            const double *coeff) );
00315 void g2h_DrawSplBFDomcd ( GHoleDomaind *domain, int fn,
00316                           void (*drawpoly)(int degree, int lastknot,
00317                                            const double *knots,
00318                                            const double *coeff) );
00319 void g2h_DrawSplFinalSurfBCd ( GHoleDomaind *domain,
00320                                int spdimen, const double *hole_cp,
00321                                const double *acoeff,
00322                                void (*drawcurve)(int degree, int spdimen,
00323                                              int lastknot, const double *knots,
00324                                              const double *cp) );
00325 
00326 void g2h_DrawSplMatricesd ( GHoleDomaind *domain,
00327                             void (*drawmatrix)( int k, int r, int s, int t,
00328                                                 double *A, double *B ) );
00329 
00330 boolean g2h_GetSplABasisFPatchCurved ( GHoleDomaind *domain, int fn, int i,
00331                                        int *lkn, double *kn, double *bfpc );
00332 boolean g2h_GetSplBBasisFPatchCurved ( GHoleDomaind *domain, int fn, int i,
00333                                        int *lkn, double *kn, double *bfpc );
00334 boolean g2h_GetSplDBasisFPatchCurved ( GHoleDomaind *domain, int fn, int i,
00335                                        int *lkn, double *kn, double *bfpc );
00336 
00337 /* ///////////////////////////////////////////////////////////////////////// */
00338 int g2h_SymPatchMatrixSize ( int hole_k );
00339 boolean g2h_GetSymPatchMatrixd ( GHoleDomaind *domain, double *patchmatrix );
00340 boolean g2h_GetExtSymPatchMatrixd ( GHoleDomaind *domain, double *patchmatrix );
00341 boolean g2h_MatrixFillSymHoled ( int hole_k, const double *patchmatrix,
00342                                  int spdimen, const double *hole_cp, void *usrptr,
00343                                  void (*outpatch) ( int n, int m, const double *cp,
00344                                                     void *usrptr ) );
00345 /* ///////////////////////////////////////////////////////////////////////// */
00346 int g2h_GetErrorCoded ( GHoleDomaind *domain, char **ErrorString );
00347 
00348 #ifdef __cplusplus
00349 }
00350 #endif
00351 
00352 #endif
00353