/********************************************************************/ /* */ /* This file is part of the VARKON Geometry Library. */ /* URL: http://www.varkon.com */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Library General Public */ /* License as published by the Free Software Foundation; either */ /* version 2 of the License, or (at your option) any later */ /* version. */ /* */ /* This library is distributed in the hope that it will be */ /* useful, but WITHOUT ANY WARRANTY; without even the implied */ /* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */ /* PURPOSE. See the GNU Library General Public License for more */ /* details. */ /* */ /* You should have received a copy of the GNU Library General */ /* Public License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 675 Mass Ave, Cambridge, */ /* MA 02139, USA. */ /* */ /* (C)Microform AB 1984-1999, Gunnar Liden, gunnar@microform.se */ /* */ /********************************************************************/ #include "../../DB/include/DB.h" #include "../include/GE.h" /********************************************************************/ /*! */ /* Function: varkon_vda_rsur4 File: sur554.c */ /* =============================================================== */ /* */ /* Purpose */ /* ------- */ /* */ /* Retrieve coefficients for the VDA-FS surface. */ /* */ /* Author: Gunnar Liden */ /* */ /* Revisions */ /* */ /* 1996-11-02 Originally written */ /* 1996-11-13 idum1, idum2 for sscanf */ /* 1996-11-14 Surface type */ /* 1999-12-04 Free source code modifications */ /* */ /******************************************************************!*/ /* ------------- Short description of function -----------------*/ /* */ /*sdescr varkon_vda_rsur4 Coefficients for VDA-FS surface */ /* */ /*------------------------------------------------------------- */ /*!-------------- Function calls (external) ------------------------*/ /* */ /* varkon_vda_rp3 * Get P3_PAT data from VDA-FS file */ /* varkon_vda_rp5 * Get P5_PAT data from VDA-FS file */ /* varkon_vda_rp7 * Get P7_PAT data from VDA-FS file */ /* varkon_vda_rp9 * Get P9_PAT data from VDA-FS file */ /* varkon_vda_rp21 * Get P21_PAT data from VDA-FS file */ /* varkon_erpush * Error message to terminal */ /* */ /*-----------------------------------------------------------------!*/ /*!------------ Error messages and warnings ------------------------*/ /* */ /* SU2993 = Severe program error ( ) in varkon_vda_rsur4 (sur554) */ /* */ /*-----------------------------------------------------------------!*/ /*!****************** Function **************************************/ /* */ DBstatus varkon_vda_rsur4 ( /*-------------- Argument declarations -----------------------------*/ /* */ /* In: */ /* */ FILE *f_vda, /* Input VDA-FS file (ptr) */ DBint nu, /* Number of patches in U direction (ptr) */ DBint nv, /* Number of patches in V direction (ptr) */ DBPatch *p_pat, /* Topological patch data (ptr) */ /* */ /* Out: */ /* */ DBint *p_sur_type ) /* Surface type (ptr) */ /* */ /* Data to */ /* */ /*-----------------------------------------------------------------!*/ /*!New-Page--------------------------------------------------------!*/ { /* Start of function */ /*!New-Page--------------------------------------------------------!*/ /*!--------------- Internal variables ------------------------------*/ /* */ DBint iu; /* Loop index U patch */ DBint iv; /* Loop index V patch */ DBint n_degu; /* Degree in U direction */ DBint n_degv; /* Degree in V direction */ DBPatch *p_t; /* Current patch (ptr) */ /* */ /*-----------------------------------------------------------------!*/ char w_1[80]; /* Dummy word 1 from line */ char w_2[80]; /* Dummy word 2 from line */ char rad[133]; /* One line in the VDA-FS file */ int idum1,idum2; /* Dummy int's for sscanf */ DBint sur_type; /* Surface type */ DBint status; /* Error code from a called function */ char errbuf[80]; /* String for error message fctn erpush */ /*--------------end-of-declarations---------------------------------*/ /*! */ /* Algorithm */ /* ========= */ /* !*/ /*! */ /* Check of input data and initializations */ /* !*/ #ifdef DEBUG if ( dbglev(SURPAC) == 2 ) { fprintf(dbgfil(SURPAC),"sur554*Enter* \n"); fflush(dbgfil(SURPAC)); /* To file from buffer */ } #endif n_degu = I_UNDEF; n_degv = I_UNDEF; sur_type = I_UNDEF; sprintf(w_1, "%s","Undefined 1\n"); sprintf(w_2, "%s","Undefined 2\n"); /*! */ /* Loop for all patches in the surface */ /* !*/ for ( iv=0; iv