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: s6drawseq.c,v 1.3 1994-12-19 16:58:19 pfu Exp $
45  *
46  */
47 
48 
49 #define S6DRAWSEQ
50 
51 #include "sislP.h"
52 
53 #if defined(SISLNEEDPROTOTYPES)
54 extern void s6move(DOUBLE[]);
55 extern void s6line(DOUBLE[]);
56 #else
57 extern void s6move();
58 extern void s6line();
59 #endif
60 
61 #if defined(SISLNEEDPROTOTYPES)
62 void
s6drawseq(double epoint[],int ipoint)63   s6drawseq(double epoint[],int ipoint)
64 #else
65 void s6drawseq(epoint,ipoint)
66      double epoint[];
67      int ipoint;
68 #endif
69 /*
70 *********************************************************************
71 *
72 *********************************************************************
73 *
74 * PURPOSE    : Draw a broken line as a sequence of straight lines
75 *              described by the array epoint.
76 *
77 *
78 *
79 * INPUT      : epoint - Array describing the corners of the broken line
80 *                       to draw. Each corner is given as a 3-dimensional
81 *                       point. The corners is placed continuous in the
82 *                       array.
83 *              ipoint - Number of points in epoint.
84 *
85 *
86 * OUTPUT     :
87 *
88 *
89 * METHOD     :
90 *
91 *
92 * REFERENCES :
93 *
94 *
95 * REMARK     : This routine is machine-dependant and the internal of
96 *              this routine has to be reprogrammed if the functions
97 *              s6move() and s6line() are not defined for your graphics
98 *              sub-system.
99 *
100 *
101 *-
102 * CALLS      : s6move - Place pen at given position (empty dummy routine).
103 *              s6line - Draw a line from the current position to the given one
104 *                       (empty dummy routine).
105 *
106 * WRITTEN BY :
107 *
108 *********************************************************************
109 */
110 {
111   int ki;          /* Counter.                                    */
112   double *spoint;  /* Pointer to corner point in the broken line. */
113 
114   /* Position pen at start of the broken line.  */
115 
116   s6move(epoint);
117 
118   /* Draw sequence of line-segments.  */
119 
120   for (ki=1,spoint=epoint+3; ki<ipoint; ki++,spoint+=3)
121     s6line(spoint);
122 
123   return;
124 }
125