1 /*
2  * Copyright (C) 1998, 2000-2007, 2010, 2011, 2012, 2013 SINTEF ICT,
3  * Applied Mathematics, Norway.
4  *
5  * Contact information: E-mail: tor.dokken@sintef.no
6  * SINTEF ICT, Department of Applied Mathematics,
7  * P.O. Box 124 Blindern,
8  * 0314 Oslo, Norway.
9  *
10  * This file is part of SISL.
11  *
12  * SISL is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Affero General Public License as
14  * published by the Free Software Foundation, either version 3 of the
15  * License, or (at your option) any later version.
16  *
17  * SISL is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU Affero General Public License for more details.
21  *
22  * You should have received a copy of the GNU Affero General Public
23  * License along with SISL. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  * In accordance with Section 7(b) of the GNU Affero General Public
27  * License, a covered work must retain the producer line in every data
28  * file that is created or manipulated using SISL.
29  *
30  * Other Usage
31  * You can be released from the requirements of the license by purchasing
32  * a commercial license. Buying such a license is mandatory as soon as you
33  * develop commercial activities involving the SISL library without
34  * disclosing the source code of your own applications.
35  *
36  * This file may be used in accordance with the terms contained in a
37  * written agreement between you and SINTEF ICT.
38  */
39 
40 #include "sisl-copyright.h"
41 
42 /*
43  *
44  * $Id: makecvkreg.c,v 1.7 1994-11-30 14:37:16 pfu Exp $
45  *
46  */
47 
48 
49 #define MAKE_CV_KREG
50 
51 #include "sislP.h"
52 
53 
54 #if defined(SISLNEEDPROTOTYPES)
55 void
make_cv_kreg(SISLCurve * pc,SISLCurve ** rcnew,int * jstat)56     make_cv_kreg (SISLCurve * pc, SISLCurve ** rcnew, int *jstat)
57 #else
58 void
59    make_cv_kreg (pc, rcnew, jstat)
60      SISLCurve *pc;
61      SISLCurve **rcnew;
62      int *jstat;
63 #endif
64 /*
65 ********************************************************************
66 *
67 *********************************************************************
68 *
69 * PURPOSE    : To convert a curve to a k-regular basis.
70 *
71 *
72 *
73 * INPUT      : pc	- Curve to be made k-regular.
74 *
75 *
76 *
77 * OUTPUT     : rcnew	- The new curve on a k-regular basis.
78 *              jstat	- status messages
79 *                                         > 0      : warning
80 *                                         = 0      : ok
81 *                                         < 0      : error
82 *
83 *
84 * METHOD     :
85 *
86 *
87 * REFERENCES :
88 *
89 *-
90 *
91 * WRITTEN BY : Ulf J. Krystad, SI, 04.92.
92 * Revised by : Paal Fugelli, SINTEF, Oslo, Norway, 94-08. Added error propagation.
93 * Revised by : Paal Fugelli, SINTEF, Oslo, Norway, Nov.1994. Set cuopen flag to
94 *              closed when changed from periodic.
95 **********************************************************************/
96 {
97    int kn=pc->in;	/* Number of vertices in 1. par. dir.  */
98    int kk=pc->ik;	/* Order in 1. par. dir.               */
99    /* --------------------------------------------------------- */
100    /* Pick part of curve */
101    s1712 (pc, pc->et[kk-1], pc->et[kn], rcnew, jstat);
102   if (*jstat < 0)  goto error;
103 
104    if (pc->cuopen == SISL_CRV_PERIODIC )
105      (*rcnew)->cuopen = SISL_CRV_CLOSED;
106 
107   goto out;
108 
109   /* Error in lower level routine */
110 error:
111   s6err ("make_cv_kreg", *jstat, 0);
112 
113 out:;
114 
115 }
116